Jump to content

Resolved - Odd behavior for Lookup Order when customer is NOT logged i


Dirty Butter

Recommended Posts

I've added this to my bug report about the Lookup Order function, but thought I'd see if anyone here has any ideas about what's wrong.

When the customer does the lookup, but does NOT login first, the item price shows as zero and the state shows as the ISO code number, rather than the word.

Any ideas how to fix this???

Link to comment
Share on other sites

In the file cubecart.class.php, at around line 1956, we are in a section of a logged-in customer's view order code. We see that 'state', 'country', 'state_d', and 'country_d' are processed.

Moving down to about line 2079, we are in a section of a non-logged-in customer's view order code that more or less duplicates the above. We see that only 'country' and 'country_d' is processed.

To fix this, add above the statements $order['country'] and $order['country_d'], these two lines:


$order['state']        = getStateFormat($order['state']);

$order['state_d']    = is_numeric($order['state_d']) ? getStateFormat($order['state_d']) : $order['state_d'];

In the image of the non-kurouoto skin, I'm concerned that the state is number 441 and the kurouto skin the state is number 1.

State Id 1 is Alabama, but 441 is Avon UK.

I haven't found a reason for the zero price but double check that record in the database to make a sure a price was entered. Or maybe it is easiest to review these orders in the admin side.

Link to comment
Share on other sites

As for the price, I see that you have a modified skin and a commercial skin. Please try an unmodified bona fide stock CubeCart skin.

I am concerned that there may have been a change to the skin code that affects the display of line items of which change was not properly applied to your modified and custom skins.

But then you hint that a logged-in customer sees the line item's total price. Well then..................

Link to comment
Share on other sites

Ok, I found a likely suspect, but haven't fully explored it.

Lines 2063 and 2064, flip the order. That is, make:


$item['price'] = $GLOBALS['tax']->priceFormat($item['price']);

$item['price_total'] = $GLOBALS['tax']->priceFormat(($item['price'] * $item['quantity']), true);



look like:



$item['price_total'] = $GLOBALS['tax']->priceFormat(($item['price'] * $item['quantity']), true);

$item['price'] = $GLOBALS['tax']->priceFormat($item['price']);

The first line formats $price before it is used by 'price_total'. That may be the problem, but there is other code that unformats the price if needed. (So many band-aids. :errm: )

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