Skip to main content

Display Message in Hikashop

More
14 years 10 months ago #31097 by anushka0703
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.

More
14 years 10 months ago #31102 by nicolas
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.

More
14 years 10 months ago - 14 years 10 months ago #31104 by anushka0703
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: 14 years 10 months ago by anushka0703.

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

More
14 years 10 months ago #31112 by nicolas
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.

More
14 years 9 months ago - 14 years 9 months ago #31172 by anushka0703
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: 14 years 9 months ago by anushka0703.

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

More
14 years 9 months ago #31198 by nicolas
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.

More
14 years 9 months ago #31280 by anushka0703
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.203 seconds
Powered by Kunena Forum