modifiy the add to cart popup

  • Posts: 73
  • Thank you received: 1
11 years 8 months ago #93607

I am customizing hikashop pretty drastically (step based webshop). I currently have a complete custom view where I want to call the notice.php file in such a way that for 1 view it contains certain buttons and for another view another set of buttons. Kind of vague, i know. But let me try to explain it:

I have 1 product (productA) which requires the proceed to checkout button to actually be a button which redirects to another product (productB) (obviously i will change the text of "proceed to checkout" to something else). Then when the user adds productB to the cart, I want the regular pop up to appear where the proceed to checkout button acts normally. My idea was to have notice.php to be the regular one when productB is added to the cart, and notice_custom.php to be the notice for productA. But how do I get this to work? I can't figure out where the file is called.

Also one other thing that I am struggling with: how do i get the entire cart object. It is not in

$this
. I basically want to display the whatever is inside the cart. Could I perhaps load the cart module?
Thanks for your time in advance :)

Last edit: 11 years 8 months ago by Ortix.

Please Log in or Create an account to join the conversation.

  • Posts: 26152
  • Thank you received: 4027
  • MODERATOR
11 years 8 months ago #93720

Hi,

You can load the current full cart using the cart class.

$cartClass= hikashop_get('class.cart');
$fullcart = $cartClass->loadFullCart();
At this moment you would get the full cart object.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
Last edit: 11 years 8 months ago by Jerome.

Please Log in or Create an account to join the conversation.

  • Posts: 73
  • Thank you received: 1
11 years 8 months ago #93763

and is there a way to pass the contents of the cart to the cart view? Whenever i load the view it says the cart is empty..

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
11 years 8 months ago #93887

Hi,

You can use the code given by Jerome where you want, but when the popup is displayed the product is added to cart (background process) so if you do a loadFullCart() in the notice you will get the product present before the last one is added to the cart. So if it's the first product added, you have empty cart.

To change the action on the product A, you have to create a custom field (business version) in the table product, and edit the view "product / quantity" to display the other button is the field "your_field" is not empty.
The best way is to set the "productB" url in the custom field for the productA, and in the view edited display a button with the link set in the custom field.

It require some custom code, and PHP knowledge.

Please Log in or Create an account to join the conversation.

Time to create page: 0.059 seconds
Powered by Kunena Forum