Jump to content

Issue: missing option on Order Summary - bug


wilded1

Recommended Posts

This is a weird one.

Ok when an order is placed the order summary displays the products purchased and includes any options selected for that product

At this point, if you click the print icon, you get the docket and it displays both the product description and the options that were selected as well.

 

This is where It gets weird

However, if you hit 'Save' on on any of the tabs pages, the product options are wiped out and no longer display on the order summary or the printed docket.

 

v6.0.1

Edited by wilded1
Link to comment
Share on other sites

Have now upgraded to version 6.0.2 and the issue persists.

 

order-1.jpg

1. a new order comes in and the order summary displays the items order complete with any options selected (1)

 

order-2.jpg

2. do anything on the 'Delivery' tab and hit 'Save' or Save and reload'; even do nothing and just hit save (2)

 

order-3.jpg

 

3. back on the 'General tab the options have disappeared (3)

Link to comment
Share on other sites

I think I may have found the culprit:

 

admin/skins/default/templates/element.product_options.php

 

select list starting at line 18

<select name="inv[{$product.id}][productOptions][{$option.option_id}]" id="option_{$option.option_id}" class="nomarg options_calc">
      <option value="">{$LANG.form.please_select}</option>
      {foreach from=$option.values item=value}
      <option value="{$value.assign_id}"{if $value.selected} selected="selected"{/if} rel="{$value.symbol}{$value.decimal_price}">{$value.value_name}{if $value.price} ({$value.symbol}{$value.price}){/if}</option>
      {/foreach}
      </select>

If I'm not wrong, the first option value should be the option variable of the inventory item?

Link to comment
Share on other sites

The presentation of the problem is that selected="selected" never becomes part of the HTML. That is caused by $value.selected not being true for the option that was selected when purchased.

 

That situation comes from Catalogue->displayProductOptions(), lines 406-415, and then lines 434 or 445. For a reason I am on the verge of discovering, the array element 'selected' does not take on a true or false value.

Link to comment
Share on other sites

Any update on this?

 

As I see it.... The data does already exist and displays on the general tab and the printout at the point prior to  you clicking the save button, it is just not being displayed in the inventory items option list,, so once save is clicked the option is overwritten and nulled out.

 

can the same data that is being listed in the general tab be included as the default value in the select list on the inventory tab?

 

If the select list was to display the item option if isset else 'please select'.

Link to comment
Share on other sites

That's exactly the case: there is a "textual" representation of the options that were chosen when the item was placed in the basket, and an "assignment_id" representation that is new in CC6 that is used to eventually set a flag for the HTML "selected" attribute of a <selector><option> form element.

 

For some reason, the flag is not being set. I (think) I submitted a bug report on this. But then I let myself get side-tracked.

Link to comment
Share on other sites

I have done a dirty fix for my clients cart to get it working.

 

I've discussed with my client and as he does not and doesn't intent to, use the Inventory tab, I have removed the content of the inventory tab and now the order keeps its options when saved.

 

admin/skins/default/templates/orders.index.php
 

Deleted block starting around line 300 (mines hacked, so it may vary) beginning:

 <div id="order_inventory" class="tab_content">
         <h3>{$LANG.orders.title_order_inventory}</h3>
         <div style="display: none;">
            <span class="actions">
            <i class="fa fa-trash" title="{$LANG.common.delete}"></i>
            </span>
         </div>
 
and ending around line 451; to just above
  <div id="order_notes" class="tab_content">
         <h3>{$LANG.orders.title_order_notes}</h3>
         {if isset($LIST_NOTES)}{foreach from=$LIST_NOTES item=note}
         <div class="note">
Link to comment
Share on other sites

@ fantastichearts.

We do understand what is causing the issue. it is the inventory edit tab not listing a products options that were ordered; that means the options will be overwritten with null if the order is saved in Admin Orders; this includes adding notes, delivery date, tracking info or changing an orders status (anything).

I did a dirty fix by removing the content of the inventory tab altogether (SEE ABOVE); it wasn't an issue for my client.

bsmither has since posted a code hack on GitHub (see link in his post above); I have not tried that hack, as I had already performed my dirty fix workaround and my client was happy; I'll wait for an updated version of CC and upgrade then.

Edited by wilded1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...