- Posts: 18
- Thank you received: 2
Get Shipping data before Chekout
10 years 3 months ago - 10 years 3 months ago #244078
by Head
Get Shipping data before Chekout was created by Head
-- HikaShop version -- : 2.6.3
-- Joomla version -- : 3.5.1
-- PHP version -- : 5.6
I use shipping methods which are restricted to specific postal codes. The postal code is the first thing the user has to provide when he enters the site.
I now have to show the shipping price with tax when the cart is created (before checkout). I can get the appropriate shipping method, but I'm unable to get the full price with tax, or the shipping price entered in the backend product form (some variants have different shipping prices).
In the product/cart.php Template I get the usable shippings this way:
-- Joomla version -- : 3.5.1
-- PHP version -- : 5.6
I use shipping methods which are restricted to specific postal codes. The postal code is the first thing the user has to provide when he enters the site.
I now have to show the shipping price with tax when the cart is created (before checkout). I can get the appropriate shipping method, but I'm unable to get the full price with tax, or the shipping price entered in the backend product form (some variants have different shipping prices).
In the product/cart.php Template I get the usable shippings this way:
Code:
$fakeAddress = new stdClass();
$fakeAddress->address_post_code = JFactory::getApplication()->getUserState(HIKASHOP_COMPONENT . '.postalcode');
$cartClass = hikashop_get('class.cart');
$cart = $cartClass->loadCart($row->cart_id);
$cart->shipping_address = $fakeAddress;
$shippingClass = hikashop_get('class.shipping');
$rates = $shippingClass->getShippings($cart);
//print_r($rates);
Last edit: 10 years 3 months ago by Head.
Please Log in or Create an account to join the conversation.
Less
More
- Posts: 12953
- Thank you received: 1778
10 years 3 months ago #244080
by Mohamed Thelji
Replied by Mohamed Thelji on topic Get Shipping data before Chekout
Hello,
If you succeed to retrieve available shipping methods based on your customer post code, then a solution can be to directly retrieve your shipping price by checking the "hikashop_shipping_price" table.
If you succeed to retrieve available shipping methods based on your customer post code, then a solution can be to directly retrieve your shipping price by checking the "hikashop_shipping_price" table.
Please Log in or Create an account to join the conversation.
Time to create page: 0.206 seconds