You can test the quantity of a Product that is in the cart with:
where 12 is the products_id for the Product ...Code:$chk_cart_products_id = $_SESSION['cart']->in_cart_check('products_id','12');
You can test the quantity of a Product that is in the cart with:
where 12 is the products_id for the Product ...Code:$chk_cart_products_id = $_SESSION['cart']->in_cart_check('products_id','12');
Linda McGrath
If you have to think ... you haven't been zenned ...
Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!
Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here
Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!
Hi thanks very much for that Ajeh.
There is more than 1 product now that is excluded from discount.
Instead of getting back the quantity of a product id, how could I get back the sum of each £value for an array of id's.
Then how would I add 10% of the returned £ value back to the total...
Sorry I programming experience is very limited!
Do these Products use Attributes?
Linda McGrath
If you have to think ... you haven't been zenned ...
Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!
Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here
Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!
Hi, thanks for the reply.
Yes, there are 5 products and all but one have attributes.
I don't have a simple method for you to calculate the amount of some products out of the order total and this would require quite some customization to do this for a shipping module ...
Perhaps someone else who has had to do this can jump in here ...
Linda McGrath
If you have to think ... you haven't been zenned ...
Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!
Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here
Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!
Thanks Ajeh, hopefully someone has some suggestions.
I've been trying to find some other way to do this for the past few days, but amending the code in the storepick.php is the only way I can think.
Thank you for the last bit of code. I'll call up each product id individually and then do some maths on it and the discount.
Would you know how I can set up a php file for testing the result of the bit of code you have supplied. If tried with the following code but can't get a result in my browser:
Thank you again.Code:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Untitled Document</title> </head> <?php echo $chk_cart_products_id = $_SESSION['cart']->in_cart_check('products_id','12'); ?> <body> </body> </html>
You cannot just stick code in a file and try to run Zen Cart code from it ... there isn't any of the initial setup of code before you are trying to run that ...
You could try to run that from an existing file such as in the shipping module, you can often echo what you are testing ...
Linda McGrath
If you have to think ... you haven't been zenned ...
Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!
Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here
Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!
Hey, is there a way to apply a discount per item for store pickup or does it have to be a percentage of the entire order? Also, can I change the text to say 'Market pickup' rather than 'Store pickup'?
You could customize the Store Pickup storepickup shipping module to take the Shipping Cost set in the Modules ... Shipping ... when you edit the shipping module and calculate the number of items in the Cart and set a discount based on count:
So if you set the Shipping Cost to: 1.00 ... then it will calculate all of the items in the cart and reduce it by the Free Shipping items, such as Gift Certificates and Downloads, and multiply that by the Shipping Cost ...Code:function quote($method = '') { global $order; global $cart; $chk_count = -($_SESSION['cart']->count_contents() - $_SESSION['cart']->free_shipping_items()); $this->quotes = array('id' => $this->code, 'module' => MODULE_SHIPPING_STOREPICKUP_TEXT_TITLE, 'methods' => array(array('id' => $this->code, 'title' => MODULE_SHIPPING_STOREPICKUP_TEXT_WAY, 'cost' => $chk_count * MODULE_SHIPPING_STOREPICKUP_COST))); if ($this->tax_class > 0) {
This has already set the amount to a negative amount so enter: 1.00 for a discount and, if for some bizzaro reason you want to charge for the Pickup per item then enter: -1.00 ...
You can make that amount anything you want ... I just used $1.00 per Product per Quantity for this this example ...
Linda McGrath
If you have to think ... you haven't been zenned ...
Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!
Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here
Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!