LemonStand Forum: get_data_field() returns NULL for logged in customer - LemonStand Forum

Jump to content

Severity 0 - None Assigned Status Unconfirmed
Version - Fixed in -

Page 1 of 1
  • Cannot start a new Issue
  • You cannot reply to this issue

Report ID #179: get_data_field() returns NULL for logged in customer

#1 User is offline  
cshamoh 

  • LemonRegular
  • PipPipPip
  • Group: Members
  • Posts: 33
  • Joined: 11-January 10

Posted 28 March 2012 - 10:07 AM

How to repliacate it?
Windows XP, XAMPP with Apache/2.2.21 and PHP 5.3.8
I have a product page where I have item_data[x_mac_address] field that is required to add product to cart.
On the cart page I have regular items listing with one
<td><?=h($item->get_data_field('x_mac_address'))</td>

It works perfeclty when customer is not logged in - I adda product to cart and I can see MAC addresses I provided on the list.
Once I login - products in the cart stay (overwrite setting), but MAC addresses are gone.
There are no MAC addresses on the list if I add products to the cart as already logged in customer.
Strangely multiple same products with different item_data[x_mac_address] are listed separately.

$id = $item->get_data_field('x_mac_address');
var_dump($id);

code above shows NULL.

I hope I made myself clear enough and that my issue is not a time waster for you.
Let me know if I can provide additional info.

Regs
K


Page 1 of 1  
  • Cannot start a new Issue
  • You cannot reply to this issue

Replies (1 - 2)

#2 User is offline  
Manca 

  • Developer
  • Group: +Administrators
  • Posts: 252
  • Joined: 02-September 11

Posted 28 March 2012 - 02:25 PM

Updating status to: Unconfirmed

Hi K,

It works in our test store. Have you added the x_mac_address field to the shop_customer_cart_items table as specified in the documentation?
The cart item data for a logged in customer is fetched from the database while for a guest customer it's stored in the session. If the field is not created in the database, then that's why it's not showing up.

Thank you

#3 User is offline  
cshamoh 

  • LemonRegular
  • PipPipPip
  • Group: Members
  • Posts: 33
  • Joined: 11-January 10

Posted 29 March 2012 - 01:57 PM

Being honest I missed that part of docs. Not very wisely I assumed that this is purely session stored (in both situations). I haven't checked it yet, but I guess we can close the issue... Thank you.


Page 1 of 1
  • Cannot start a new Issue
  • You cannot reply to this issue

0 User(s) are reading this issue
0 Guests and 0 Anonymous Users