Kryptronic Software Support Forum

You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.

#1 06-27-2017 06:33:42

nigel
Member
From: Peterborough, UK
Registered: 04-27-2008
Posts: 418
Website

product name in cart instead of inventory name

I would prefer to have the "product offer name" as opposed to the "inventory item name" showing in the shopping cart. I edited cartdisplay.php and changed xinvid to xprodid which seems to work. Have I done the right thing and will it have any adverse effect elsewhere?

Code:

// +--
          // | Display Name Override
          // +--

          if (!(empty($offeritem['xinvid']))) {

               $dispname = $offeritem['name']; if ($shownums) {$dispname = $offeritem['number'] . ' - ' . $offeritem['name'];}

               if ($offeritem['imgsm'] != 'none.png') {$dispimg = 'media/ecom/invsm/' . $offeritem['imgsm'];}

          } // End of if statement.

Offline

 

#2 06-27-2017 08:02:39

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19798
Website

Re: product name in cart instead of inventory name

I wouldn't do that.  What happens when your offers start allowing customers to select different inventory items, or you start offering package deals of inventory items?  For now it would be much better to just rename the inventory items and leave things as they are.  If your vendors need a different name for the inventory items, there's a vendor description field for that (vendor item number too).


Nick Hendler

Offline

 

#3 06-27-2017 08:16:24

nigel
Member
From: Peterborough, UK
Registered: 04-27-2008
Posts: 418
Website

Re: product name in cart instead of inventory name

the problem I have is that I stock a tyre which is suitable for several different strollers. The inventory name is "tyre 1234" and is associated with 10 different product offers. If a customer orders product offer "Tyre for Quinny Buzz Stroller" it shows in the cart as "tyre 1234" and they might think they have ordered the wrong item. Is there a way around this?

Offline

 

#4 06-28-2017 09:15:02

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19798
Website

Re: product name in cart instead of inventory name

Interesting.  Perhaps the best thing to do in your case would be to prepend or append the offer name to the inventory item name when saved to the cart in the build_item() function in {private}/apps/ecom/ECOM_Cart/ECOM_Cart.php.  Look for:

Code:

$item['name']                  = (isset($offer['name']) ? $offer['name'] : 'Item');

Right below it, add:

Code:

if (!(empty($pricemap['xinvid']))) {$item['name'] .= ' (' . $item['offername'] . ')';}

This covers you everywhere, all the way through checkout and the order process.  Your cart display mod only covered you on the shopping cart page.


Nick Hendler

Offline

 

#5 06-28-2017 09:15:13

robprotronica
Member
Registered: 12-16-2008
Posts: 106

Re: product name in cart instead of inventory name

From modifying some other displays, the $offers array usually contains a lot of useful info including the custom data fields for both the Product Offer and Inventory item. I am sure there will be something with both.

The first thing I would try would be to add some custom data to the inventory item to flag additional info may be available and then to put custom data in the Product Offer e.g. "for Quinny Buzz Stroller".

That way you can look for the tag in the inventory item and if present add the extra info onto the description.

"tyre 1234"
"for Quinny Buzz Stroller" (could style that also)

Just a suggestion

Rob

Offline

 

#6 07-03-2017 07:03:15

nigel
Member
From: Peterborough, UK
Registered: 04-27-2008
Posts: 418
Website

Re: product name in cart instead of inventory name

thank you both for your suggestions.

Nick - I tried yours but it made no difference. Do I still need to edit cartdisplay.php as per my first post?

Offline

 

#7 07-05-2017 09:47:31

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19798
Website

Re: product name in cart instead of inventory name

No, you would not need to make any other edits.


Nick Hendler

Offline

 

Board footer