Post by gustvao » Fri Jun 22, 2012 3:41 am

Is there a way to check in ADMIN what is the saved Cart list of the customers? I.e., client logs in, add products to the cart and leave without shopping. This info is stored into CUSTOMER table CART field. What is the logic behind it? Is there an easy way to dump that data into products/details ??

tksvm
Gustavo

Newbie

Posts

Joined
Thu Oct 13, 2011 3:19 am

Post by Avvici » Fri Jun 22, 2012 12:11 pm

Very simple to do. You would simply need to unserialize the string similar to what you see in the system file customer.php

Code: Select all

if (($customer_query->row['cart']) && (is_string($customer_query->row['cart']))) {
				$cart = unserialize($customer_query->row['cart']);
Now you have an array called $cart to work with to place in product details :) If you need help further just let us now.

User avatar
Expert Member

Posts

Joined
Tue Apr 05, 2011 12:09 pm
Location - Asheville, NC

Post by gustvao » Fri Jun 22, 2012 10:42 pm

Hi Avvici, tks for your reply.

How do I call the system/customer class into another ADMIN page?

I am struggling here to do so.

So far I managed to add the front end code in admin/view/template/sale/customer_form.tpl. Could you pls help me to pull/use the system/customer class to the admin/controller/customer.php file so my front end works?

Tks vm again,
Gustavo.

Newbie

Posts

Joined
Thu Oct 13, 2011 3:19 am

Post by straightlight » Fri Jun 22, 2012 10:48 pm

The only way to call indirectly the customer class would be by, first, logging into a customer's account from admin - > sales - > customers or by, first, log-in into a customer account straight on the store-front end and then log-in into the admin. This methodology would only capture the current customer ID with the session data but you won't be able to use the customer's class directly.

If you wish to capture another customer's ID, you don't necessarily need the customer library to do that. You could simply gather the customer's sale model instead on the admin end from your desired admin controller file:

Code: Select all

$this->load->model('sale/customer');

$this->data['customer_info'] = $this->model_sale_customer->getCustomer($this->request->get['customer_id']);
by making sure you do receive the desired customer_id from URL or manually entered before you wish to see the info on page.

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.


Regards,
Straightlight
Opencart.com Administrator / Quality Assurance Analyst / Programmer


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by gustvao » Sat Jun 23, 2012 4:44 am

Tks for the reply.

I believe I am on the right track but still receiving some erros, can someone pls help me?

Error:
Notice: Undefined variable: key in /home/mandapracasa/teste/vqmod/vqcache/vq2-admin_view_template_sale_customer_form.tpl on line 227Warning: Invalid argument supplied for foreach() in /home/mandapracasa/teste/vqmod/vqcache/vq2-admin_view_template_sale_customer_form.tpl on line 227
Last edited by gustvao on Sun Jun 24, 2012 1:23 am, edited 1 time in total.

Newbie

Posts

Joined
Thu Oct 13, 2011 3:19 am

Post by straightlight » Sat Jun 23, 2012 10:46 am

Without knowing where $key would be relevant from your controller but normally $key from your template would need to come from your customer.php controller file under $this->data['key'] . Otherwise, it will obviously not provide the desired results. Although, if you already have $this->data['key'] from your controller and still see this error, it may be possible that this error may be related to empty values which this foreach loop can't simply return without implying if the $key array is empty or not. ;)

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.


Regards,
Straightlight
Opencart.com Administrator / Quality Assurance Analyst / Programmer


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by Avvici » Sat Jun 23, 2012 12:50 pm

straightlight wrote:Without knowing where $key would be relevant from your controller but normally $key from your template would need to come from your customer.php controller file under $this->data['key'] . Otherwise, it will obviously not provide the desired results. Although, if you already have $this->data['key'] from your controller and still see this error, it may be possible that this error may be related to empty values which this foreach loop can't simply return without implying if the $key array is empty or not. ;)
In other words. You need to just look in you control at the 'key" variable/aray and know that it's not correct. :crazy:
Startlight I was just giving the layman version lol.

User avatar
Expert Member

Posts

Joined
Tue Apr 05, 2011 12:09 pm
Location - Asheville, NC

Post by straightlight » Sat Jun 23, 2012 6:34 pm

Not exactly since it may be correct statement from the controller regarding the variable itself but the content may also be emptied but not verified.

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.


Regards,
Straightlight
Opencart.com Administrator / Quality Assurance Analyst / Programmer


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by gustvao » Sun Jun 24, 2012 1:25 am

tks vm for the tips guys, however my problem was simpler: i was using the incorrect file to make the mods :choke:

take care

Newbie

Posts

Joined
Thu Oct 13, 2011 3:19 am

Post by straightlight » Sun Jun 24, 2012 2:10 am

Thanks for the clarification.

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.


Regards,
Straightlight
Opencart.com Administrator / Quality Assurance Analyst / Programmer


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by Avvici » Sun Jun 24, 2012 5:07 am

straightlight wrote:Not exactly since it may be correct statement from the controller regarding the variable itself but the content may also be emptied but not verified.
You misunderstood me. The point is that he solved it himself. Go team!

User avatar
Expert Member

Posts

Joined
Tue Apr 05, 2011 12:09 pm
Location - Asheville, NC
Who is online

Users browsing this forum: Baidu [Spider] and 49 guests