How to Show Product Code

[quote name=‘knoxbury’]Yes, this is only a problem with product options.[/quote]



We use product options for each and every product everyday. This is what I’ve got working on my current store (abeit different layout)





You’ll want to put that code
{hook name="orders:product_info"}
{if $oi.product_code}

$oi.product_code}


{/if}{/hook}




where you want the product code to appear, just to make sure it works, put it under the price field and test from there.

[quote name=‘JesseLeeStringer’]We use product options for each and every product everyday. This is what I’ve got working on my current store (abeit different layout)



You’ll want to put that code
{hook name="orders:product_info"}
{if $oi.product_code}

$oi.product_code}


{/if}{/hook}




where you want the product code to appear, just to make sure it works, put it under the price field and test from there.[/QUOTE]



But is this in the invoice.tpl file or options_info.tpl?

[quote name=‘knoxbury’]But is this in the invoice.tpl file or options_info.tpl?[/quote]



invoice.tpl under /mail/

[quote name=‘JesseLeeStringer’]invoice.tpl under /mail/[/QUOTE]

That’s where I’m confused. I thought that all of the info related to product option is supposed to come from the options_info.tpl file under common_templates.

[quote name=‘JesseLeeStringer’]invoice.tpl under /mail/[/QUOTE]

I just looked in the invoice.tpl file and I already have this code . . . but this code doesn’t apply to product options. I believe that comes from the option_info.tpl file.

[quote name=‘knoxbury’]WOW!!! CS-Cart just quoted me $675 in order to add the product code for product options to the invoice email without tracking status![/QUOTE]

The developers should be ashamed to charge anything to fix something that should be the standard behavior for the cart. I consider this a BUG!!!



Bob

Ok, I think I’ve discovered that this is not a problem with displaying the product code. I think the problem is that the product code is not being inserted into the order details table when the order is placed if the product ordered is a product option.



I came to this conclusion for 2 reasons:


  1. I pulled up an order in 2.0.12 that had been placed when we were running 1.3.5. This order had product options AND showed the product code for the same product that would NOT show the product code now if I placed the order using 2.0.12.


  2. So I opened up the cscart_order_details table and found that the product_code field is blank for all orders for products with options using 2.0.12.



    So point 1 shows that the display works ok if the code is in the db for a product option, but point 2 shows that 2.0.12 is not inserting this product code into the db for some reason.

[quote name=‘knoxbury’]I just looked in the invoice.tpl file and I already have this code . . . but this code doesn’t apply to product options. I believe that comes from the option_info.tpl file.[/QUOTE]

You will not be able to fix this in the mail templates. The problem is that the cart loads the product code from the main product into the cscart_order_details table when “Track without options” is set. This is incorrect - it should set the product code for the product with options. Track with/without inventory should only affect how the actual inventory amounts are handled.



Bob



EDIT: Didn’t type fast enough. This should be considered a bug. There was no reason to change from the previous functionality in the 1.3.x branch. The order details table should reflect the product code of the purchased item which includes any options.

Why not turn on Inventory Tracking real quick & see if the product sku’s now show up properly.



If they do, then it may be the simplest/cheapest fix of all to just leave inventory tracking on even though you don’t need it. Then just add very large inventory stock values to each of your products.

I know you did all of this already , just do this one more time.





Edit one of your products in the back end that have options and look somewhere in the middle of the page where it says " Track without options" change it to track with options then go to your options tab and click on it the click on option combination. Make sure you have all your options listed there with Product codes. Save . Make sure in admin /settings /general Enable inventory tracking is [COLOR=“Red”]Unchecked[/COLOR]. Now place a test order for the item you edited and see if the product code shows up.



This will not track inventory as far as I can tell from my Live and Test installs.

[quote name=‘gasngrills’]Edit one of your products in the back end that have options and look somewhere in the middle of the page where it says " Track without options" change it to track with options then go to your options tab and click on it the click on option combination. Make sure you have all your options listed there with Product codes. Save . Make sure in admin /settings /general Enable inventory tracking is [COLOR=“Red”]Unchecked[/COLOR]. Now place a test order for the item you edited and see if the product code shows up. [/QUOTE]

This works perfectly for me in a 2.0.12 setup. It’s kind of silly to have to enable inventory tracking just so you can set “Track with options” and then disable inventory tracking to make it work. It sure makes their $675 quote look ridiculous.



Bob

[quote name=‘jobosales’]This works perfectly for me in a 2.0.12 setup. It’s kind of silly to have to enable inventory tracking just so you can set “Track with options” and then disable inventory tracking to make it work. It sure makes their $675 quote look ridiculous.



Bob[/QUOTE]



Bob ,



This used to work without having track with options enabled before 2.0.14 , and now the track with options must be enabled for the options to show the way they were suppose to. They must have done something in the latest release . I had to edit all my products with options and enable track with options.



Joe

I’m not sure if this will help with version 2, but in version 1.3.5, the change was made to the [CS_CART_ROOT_DIR]core/fn_catalog.php file. I have been going to try and compare the changes between the original file and this one but haven’t got around to it yet but will do so in the next few days if anyone thinks it may help with version 2.



And it only cost me around $50 to have the change made.

[quote name=‘gasngrills’]I know you did all of this already , just do this one more time.





Edit one of your products in the back end that have options and look somewhere in the middle of the page where it says " Track without options" change it to track with options then go to your options tab and click on it the click on option combination. Make sure you have all your options listed there with Product codes. Save . Make sure in admin /settings /general Enable inventory tracking is [COLOR=“Red”]Unchecked[/COLOR]. Now place a test order for the item you edited and see if the product code shows up.



This will not track inventory as far as I can tell from my Live and Test installs.[/QUOTE]



I don’t know, that may work, but I can’t disable inventory tracking for the entire site. There are some products that I do need to track inventory on, but most products do not need inventory tracking

CS-Cart support confirmed that this is a problem where CS-Cart is not adding the product code to the order_details table when a product option is ordered. But the funny thing is that they’re saying that it would be a “bug” if the product code was added to the order_details table without tracking status.