Display Message in Hikashop

  • Posts: 11
  • Thank you received: 0
13 years 1 day ago #31097

Hi,

i am new to hikashop. I want to display a message to customer when over $75 items added to the cart. How can i do this?

how can i read the current cart value with php?

Regards,
Anushka

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

  • Posts: 82906
  • Thank you received: 13378
  • MODERATOR
13 years 20 hours ago #31102

Hi,

In the file "cart" of the view "checkout" you can get the total value in that variable:
$this->full_total->prices[0]->price_value_with_tax

You can edit it via the menu Display->Views.

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

  • Posts: 11
  • Thank you received: 0
13 years 20 hours ago #31104

Thanks nicolas.

here what i want is to display the message in a separet module.

i have installed a new module to sytem via .zip archive. in that module i have the php file. can i access the hikashop cart module inside that php file and display the message by looking at the cart total value.

if in customer's chopping cart the total is >= $75 then i have display a message that the customer has free shipping. if the total is < $75 again i have to display another message. this message is going to be displayed somewhere in the page the user can easily see.

Last edit: 13 years 19 hours ago by anushka0703.

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

  • Posts: 82906
  • Thank you received: 13378
  • MODERATOR
13 years 15 hours ago #31112

Then, from an external module, you could do like that:

if(!include_once(rtrim(JPATH_ADMINISTRATOR,DS).DS.'components'.DS.'com_hikashop'.DS.'helpers'.DS.'helper.php')) return true;
$cartClass = hikashop_get('class.cart');
$cart = $cartClass->loadFullCart();
echo $cart->full_total->prices[0]->price_value_with_tax;

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

  • Posts: 11
  • Thank you received: 0
13 years 1 hour ago #31172

Thanks nicolas,, it works perfectly.

but here is another challenge. the value $75 is given as the "Minimum price" in a manual shipping method module. How i need to read that "Minimum price" value from my external module for displaying message?

Last edit: 13 years 1 hour ago by anushka0703.

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

  • Posts: 82906
  • Thank you received: 13378
  • MODERATOR
12 years 11 months ago #31198

You should load that shipping method data. Like that:
$shippingClass = hikashop_get('class.shipping');
$shipping = $shippingClass->get($shipping_id);
$shipping->shipping_params = unserialise($shipping->shipping_params);
echo $shipping->shipping_params->shipping_min_price;


And $shipping_id need to be the id of your shipping method.

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

  • Posts: 11
  • Thank you received: 0
12 years 11 months ago #31280

Thank you nicolas. it works. you gave me a great support.

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

Time to create page: 0.060 seconds
Powered by Kunena Forum