Jump to content

Product Options Not Showing


dcmgraphics

Recommended Posts

Are the two images referencing the same order and inventory? I see the first image referring to Birthday Bash something, and the second image referring to Invitations.

I've compared the admin code between CC618 and CC6112 that deals with product options and find no differences that would explain missing option data.

So, maybe the frontside code has the problem, or the skin (or plugin) may have a problem with CC6112.

I will keep experimenting.

Edited by bsmither
Link to comment
Share on other sites

I've discovered that CubeCart's behavior (perhaps not changed over any particular later version) is that an order can be made where options can be ignored if that option is not required.

However, at a later time, that option can be made required, and it will indicate as such in the admin Order Summary, Inventory tab screen, which will be confusing if the admin does not realize when this option was made required versus when the order was made.

But that does not sound like your situation.

Link to comment
Share on other sites

Thanks bsmither for responding, strange I didn't receive an email like usual saying anyone responded to my post. Anyway, the screen shots are from two separate orders, different product items. All the options were made required years ago and I haven't changed these products for years.

The common issue is that these are text area and text box options. Do think that could be skin related? I'm using the Vector skin, which I know is outdated because the developer stopped supporting it :(

Edited by dcmgraphics
adding more information
Link to comment
Share on other sites

If the text entries do not show up in the few places they get stored, then we can look at the Vector skin.

However, if they do get collected from the form submission frontside and get databased, but aren't shown in the admin's screens, then we will focus on the admin code and skin.

So, using an external database utility such as phpMyAdmin, directly access the database.

Looking in CubeCart_saved_cart, scan through the basket column looking for inventory that has a text entry field value. You won't find the name of the text entry field, only the contents if any have been entered. This database table is used to hold shopping baskets until the customer checks out.

Looking in CubeCart_order_inventory, find a target cart_order_id. Examine the product_options and options_array columns. This database table holds the inventory summary of orders in the process of checking out and afterward.

If the text entry filed responses can be found for current orders, then the Vector skin is submitting the data and the CubeCart frontside code is getting it databased.

Link to comment
Share on other sites

Please observe whether or not you have the following situation:

In CubeCart's main folder, you should have one file named admin_aBcDeF.php (where aBcDeF is some random sequence of letters). There should no other file that starts with 'admin'.

Likewise, you should have one folder named /admin_fEdCbA/ (where fEdCbA is some random sequence of letters). There should no other folder that starts with or is simply 'admin'.

There has been a consistent issue with upgrading that results in multiple admin files and folders.

Link to comment
Share on other sites

Good. Getting this narrowed down.

To review: after upgrading to CC6112, in admin, for all orders(?), inventory that have text field option responses do not show? Or is it only orders placed after the upgrade do not show text option responses.

That is to ask, an order placed three months ago does or does not show text option responses in admin?

Using a programmer's text editor, open the admin skin template orders.index.php. At the end of the file, add {debug}. Save the file.

In admin, view an order. Your browser will want to display a popup window. Let it do so.

This is the template rendering engine's Debug Console. It lists all the variables and values. Scroll to near the bottom and find $PRODUCTS. This array will have several indications about the options for each of the order's inventory.

Verify that the text option responses are listed.

If they are, we will focus on the skin template. If not, we will focus on the core code that is supposed to find and provide this info to the skin.

Link to comment
Share on other sites

That means the core code is not doing its job correctly.

To review about the debug, for each item in $PRODUCTS, there is: product_options, options_array, options and optionally options_text. Of these four array elements, there may be references to choices from multiple choice options, but no references to text options.

I think the next step will be easier if we take this to email. I will send you my diagnostic plugin and give instruction on how to use it. This will let us examine the values of variables the core code is working with.

PM sent.

 

Link to comment
Share on other sites

  • 2 months later...

Welcome MyCAB! Glad to see you made it to the forums.

In the emails, when viewing the templates in the editor, you will see some blue blocks that indicate 'protected' code. The protected code is the template rendering engine (Smarty) syntax to create a loop.

Seeing only the last item from array means the loop did its job, but the variables to show the items somehow got outside the loop.

This can sometimes happen when having edited the email templates.

Did you recently edit the templates?

What exact version of CubeCart are you running? (admin, Dashboard, Store Overview tab)

Link to comment
Share on other sites

3 hours ago, bsmither said:

Allow me to suggest that you download the latest package from CubeCart's site.

OK that worked!! Thank you!!!   Now is there a way to make the output better?  There is nothing separating the fields.  It shows... You Are An Angel Lullaby CD
Name:: Bobby Pronunciation:: bob-ee Dedication:: With Love From From:: Mom

Link to comment
Share on other sites

This could require an edit to core code. Also, an edit to a couple of email templates. Use a programmer's text editor (such as NotePad++ or the editor available as a tool in your hosting account's control panel).

In the file /classes/order.class.php:

Near line 269, find:

if (!empty($product['product_options']))  $product['product_options'] = implode(' ', unserialize($item['product_options']));

Change to:

if (!empty($product['product_options']))  $product['product_options'] = implode('\n', unserialize($item['product_options']));

PHP's implode() function takes an array, converts it to a string, and optionally inserts something between each array element. In this case, there was a simple space and this changes it to a new-line character.

CubeCart sends every email having two parts: an HTML Content part, and a Plain Text Content part. In the Plain Text, the new line acts just like it should. However, in HTML, new-lines are ignored. HTML requires the <br/> tag.

Therefore, in admin, Email Templates, click the flag for the language you are using of the email Admin: Order Received.

On the next page, click the HTML Content tab. On the editor's toolbars, click the Source tool button.

Find:

{$product.product_options}</td>

Change to:

{$product.product_options|nl2br}</td>

This change is Smarty syntax that sends the string through a function. In this case, the nl2br function adds the <br/> tag in front of any new-line character.

Make similar changes to other languages and also to the Cart: Order Confirmed template.

(I have done this in past, but not with the latest version of CubeCart. I do not expect any problems.)

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...