What are you trying to do ...
Can you show some examples?![]()
What are you trying to do ...
Can you show some examples?![]()
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: v1.5.1]
Officially PayPal-Certified! Just click here
Try our Zen Cart Recommended Services - Hosting, Payment and more ...
We sell yarn as well as some smaller accessories. I would like a flat rate on the yarn of 7.50 and a flat rate on the sequins which are much lighter of 3.50.
http://www.stitchboutiqueboston.com/...sequins-p-471/
I would like the flat rate of $3.50 to appear on the sequins.
What about everything else?
Are all Yarn in one Category?
Are all Sequins in one Category?
Are there other Products that this has to happen to?
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: v1.5.1]
Officially PayPal-Certified! Just click here
Try our Zen Cart Recommended Services - Hosting, Payment and more ...
I would like all the categories at the same flat rate 0f 7.50 except for the accessories at 3.50.
What should shipping be when I order:
1 Accessory Product?
10 Accessory Products?
1 Accessory Product and 1 non-Accessory Product?
1 Accessory Product and 10 non-Accessory Product?
10 Accessory Product and 1 non-Accessory Product?
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: v1.5.1]
Officially PayPal-Certified! Just click here
Try our Zen Cart Recommended Services - Hosting, Payment and more ...
What should shipping be when I order:
1 Accessory Product? 3.5
10 Accessory Products? 3.5
1 Accessory Product and 1 non-Accessory Product? 7.5
1 Accessory Product and 10 non-Accessory Product? 7.5
10 Accessory Product and 1 non-Accessory Product? 7.50
You can customize the Flat Rate flat shipping module:
/includes/modules/flat.php
by customizing the code in RED:
Code:function quote($method = '') { global $order; // bof: flat rate charges global $cart; $chk_cat1 = $_SESSION['cart']->in_cart_check('master_categories_id','1'); $full_cart = $_SESSION['cart']->count_contents(); if ($chk_cat1 == $full_cart) { $flat_charge = 3.50; } else { $flat_charge = 7.50; } $this->quotes = array('id' => $this->code, 'module' => MODULE_SHIPPING_FLAT_TEXT_TITLE, 'methods' => array(array('id' => $this->code, 'title' => MODULE_SHIPPING_FLAT_TEXT_WAY, 'cost' => $flat_charge))); // eof: flate rate charges if ($this->tax_class > 0) {
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: v1.5.1]
Officially PayPal-Certified! Just click here
Try our Zen Cart Recommended Services - Hosting, Payment and more ...
I am working on a situation that is rather the reverse of the yarns/sequins problem.
I have a set of products (patterns, but they are in multiple categories based on the kind of pattern they are) for which the buyer should get a Low Flat Rate shipping (if they order less than 5 of patterns, say).
However, if *anything* else is in the cart--books, yarns, etc--the High Flat Rate should apply.
I am not sure how to edit/code this line (or nearby lines) (in /includes/modules/shipping/flat.php) to test for "any of the following category IDs" instead of just one ID:
I can get any one of the IDs to work fine, of course, following the pattern you provided in August. Any code help (or a link to a post I couldn't find yet) is most welcome!PHP Code:$chk_cat1 = $_SESSION['cart']->in_cart_check('master_categories_id','20');
(ZC version = the most recent )
(Category IDs include 20, 27, 23, and some others)
(Site: http://www.vtyarnco.com/store/ )
Thanks,
Kir
Last edited by metasilk; 15 Sep 2011 at 07:02 PM. Reason: clarifying file being edited, added site URL
Hey, I got it. Here is the code (2 categories shown) below. I started with what Ajeh posted in http://www.zen-cart.com/forum/showpo...6&postcount=27 (where she posted an edit to includes/modules/shipping/flat.php that allowed for a custom flat rate for one category).
Then I had to
1) Add up the results of the in_cart_check by adding a line of code to call this for each category I cared about, and summing those (with [FONT="Courier New"]+=[/FONT]),
and
2) including a check for the final total of items as well
I think this works (2 categories and the counts work, so far). Let me know if you see any screw ups or improvements! Feel free to cross post this to other threads if it's useful...Code:$chk_cat1 = $_SESSION['cart']->in_cart_check('master_categories_id','20'); // counts how many are of the Hats category $chk_cat1 += $_SESSION['cart']->in_cart_check('master_categories_id','26'); // counts how many are of the Mittens category $full_cart = $_SESSION['cart']->count_contents(); // counts number of items in the cart in total if ( ($chk_cat1 == $full_cart) && ($full_cart<6) ) { $flat_charge = 1.50; } else { $flat_charge = 6.00; }
Hopefully I'm not duplicating the suggestions of forty gazillion other ZCers... :)
--Kir
A new puzzle:
Current situation: if you buy 5 or fewer patterns you can get them shipped for a low price. If you buy more patterns, or buy anything else with the pattern, it's shipped for the standard flat rate. Cool.
Now I'd like to add the option: if you buy 5 or fewer patterns, you can **choose** to have them shipped at a priority mail rate (more than the default low) (and we'll ship them flat, too).
I assume I should clone the flat.php files -- so far so good. I got that cloned and installed through the admin no problem (well, except for the _ I had been using which prevented it from displaying).
But how to change the code so it
1) checks for the patterns
2) checks for the number of items
and THEN enables/disables that new priority mail module according to the results?
So far, it seems this module is all disabled -- no matter what's in the cart, it doesn't show this shipping option. I tried working within the class options (as when I was doing the low rate bit) and up by where modules get disabled when it's all free shipping...
Help welcome!
Bookmarks