Forum
Shop Cart API for postage & discount
Hi
I want to display postage & discount using API calls. like perch_shop_cart_total()
but I can seem to find any to print out the postage and discount amounts.
please help
tony
Hi
I want to display postage & discount using API calls. like perch_shop_cart_total()
but I can seem to find any to print out the postage and discount amounts.
please help
tony
You should be able to get everything from
perch_shop_cart()
using theskip-template
option.Cool!!!!
many thanks
tony
Hi,
Also, is there a way to get all the cart contents, including items/products in the cart?
tony
Yes, using the same.
ok, cool.
I need help with cart.html perch don't parse it ok. Ive checked it over and over again...
the output I get is.. Qty: [ input box ] " value="" type="number" min="0" />
code;
perch_shop_cart(['template' => 'cart/cart.html']);
cart.html
thanks in advance
tony
What have you tried to resolve it?
with debug on...
Debug Message
[1] SELECT * FROM perch2_pages WHERE pagePath='/checkout.php' LIMIT 1 [1] SELECT * FROM perch2_shop_cart WHERE cartID=152 [1] SELECT * FROM perch2_shop_cart WHERE cartID=152 [31] SELECT DISTINCT settingID, settingValue FROM perch2_settings WHERE userID=0 [1] SELECT itemID, itemQty FROM perch2_shop_cart_items WHERE cartID=152 AND productID=0 [1] SELECT * FROM perch2_shop_products WHERE productID=0 AND productDeleted IS NULL LIMIT 1 Limiting based on stock. ------------------------------ Calculating cart ------------------------------ [1] SELECT * FROM perch2_shop_cart WHERE cartID=152 [1] SELECT * FROM perch2_shop_cart WHERE cartID=152 [1] SELECT * FROM perch2_shop_tax_locations WHERE locationID=1 AND locationDeleted IS NULL LIMIT 1 [1] SELECT locationID FROM perch2_shop_tax_locations WHERE locationIsHome=1 LIMIT 1 [1] SELECT * FROM perch2_shop_tax_locations WHERE locationID=1 AND locationDeleted IS NULL LIMIT 1 [1] SELECT * FROM perch2_shop_currencies WHERE currencyID=47 LIMIT 1 [1] SELECT COUNT(productID) AS product_count, SUM(itemQty) AS item_count FROM perch2_shop_cart_items WHERE cartID=152 Tax mode: exc [1] SELECT * FROM perch2_shop_cart_items WHERE cartID=152 ORDER BY itemID ASC [1] SELECT * FROM perch2_shop_products WHERE productID=10 AND productDeleted IS NULL LIMIT 1 [1] SELECT * FROM perch2_shop_tax_groups WHERE groupID=1 AND groupDeleted IS NULL LIMIT 1 [0] SELECT r.rateValue FROM perch2_shop_tax_group_rates gr, perch2_shop_tax_rates r WHERE gr.rateID=r.rateID AND gr.groupID=1 AND gr.locationID=1 [nil] SELECT * FROM perch2_shop_promotions WHERE promoFrom<='2016-07-25 07:32:00' AND promoTo>'2016-07-25 07:32:00' AND promoActive=1 AND promoDeleted IS NULL ORDER BY promoOrder ASC UPDATE perch2_shop_cart SET cartTotalItems='4', cartTotalProducts='1', cartTotalWithTax='79.96', cartTotalWithoutTax='79.96' WHERE cartID='152' INSERT INTO perch2_shop_cart_data(cartID,productID,cartData) VALUES('152',NULL,'{\"productID\":\"10\"}') [1] SELECT itemID, itemQty FROM perch2_shop_cart_items WHERE cartID=152 AND productID=10 [1] SELECT * FROM perch2_shop_products WHERE productID=10 AND productDeleted IS NULL LIMIT 1 Limiting based on stock. UPDATE perch2_shop_cart_items SET itemQty=4 WHERE itemID=11 ------------------------------ Calculating cart ------------------------------ [1] SELECT * FROM perch2_shop_cart WHERE cartID=152 [1] SELECT * FROM perch2_shop_cart WHERE cartID=152 [1] SELECT * FROM perch2_shop_tax_locations WHERE locationID=1 AND locationDeleted IS NULL LIMIT 1 [1] SELECT locationID FROM perch2_shop_tax_locations WHERE locationIsHome=1 LIMIT 1 [1] SELECT * FROM perch2_shop_tax_locations WHERE locationID=1 AND locationDeleted IS NULL LIMIT 1 [1] SELECT * FROM perch2_shop_currencies WHERE currencyID=47 LIMIT 1 [1] SELECT COUNT(productID) AS product_count, SUM(itemQty) AS item_count FROM perch2_shop_cart_items WHERE cartID=152 Tax mode: exc [1] SELECT * FROM perch2_shop_cart_items WHERE cartID=152 ORDER BY itemID ASC [1] SELECT * FROM perch2_shop_products WHERE productID=10 AND productDeleted IS NULL LIMIT 1 [1] SELECT * FROM perch2_shop_tax_groups WHERE groupID=1 AND groupDeleted IS NULL LIMIT 1 [0] SELECT r.rateValue FROM perch2_shop_tax_group_rates gr, perch2_shop_tax_rates r WHERE gr.rateID=r.rateID AND gr.groupID=1 AND gr.locationID=1 [nil] SELECT * FROM perch2_shop_promotions WHERE promoFrom<='2016-07-25 07:32:00' AND promoTo>'2016-07-25 07:32:00' AND promoActive=1 AND promoDeleted IS NULL ORDER BY promoOrder ASC UPDATE perch2_shop_cart SET cartTotalItems='4', cartTotalProducts='1', cartTotalWithTax='79.96', cartTotalWithoutTax='79.96' WHERE cartID='152'
also html produced is below
it not working :(
tony
this seems to be parsed, as the perch:input is not in the html
<p>Qty: <perch:input id="qty:<perch:cartitem id="identifier" />" value="<perch:cartitem id="quantity" />" type="number" min="0" /> </p>
What HTML output do you get?
Hi Drew,
I was using the example perchdemo-nest cart.html
I just copy cart.html from perch/apps/shop/template/cart and that works ok. so I will modify that.
tony
Ok, great.