If this is your first visit, check our documentation. To post, register or login.
Forums / General Questions / General Questions / if product_model LIKE "Abc_%" then use table shipping else UPS

if product_model LIKE "Abc_%" then use table shipping else UPS

Started by makenoiz on 2 Nov 2012, 3:13 AM · Views: 600

Results 1 to 4 of 4
2 Nov 2012, 3:13 AM
#1
makenoiz avatar

makenoiz

Zen Follower

Join Date:
Mar 2006
Posts:
284
Plugin Contributions:
0

Post #1 by makenoiz

1.5.1 lightly modified.

Need to apply table shipping module if products.product_model begins with ABC_ . If not Id like to apply our standard shipping method of UPS.

Any pointers would be great on where to start the code modifications.

THanks

22 stores and counting! Ive been zenned.

2 Nov 2012, 8:02 AM
#2
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Post #2 by kobra

if products.product_model begins with ABC_
Are all these ABC products in one category??

Zen-Venom Get Bitten

4 Nov 2012, 10:10 PM
#3
makenoiz avatar

makenoiz

Zen Follower

Join Date:
Mar 2006
Posts:
284
Plugin Contributions:
0

Post #3 by makenoiz

No that is the problem ;)

THanks!

22 stores and counting! Ive been zenned.

5 Nov 2012, 5:55 PM
#4
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Post #4 by ajeh

You could customize the shipping modules ...

For example, to turn OFF the Zone Rate zones when there are no Products with the model **ABC_**XXX in the cart add the code in RED:

      if (zen_get_shipping_enabled($this->code)) {
        $this->enabled = ((MODULE_SHIPPING_ZONES_STATUS == 'True') ? true : false);
      }

[B]      // bof: only show if ABC product is in the cart
      if (!IS_ADMIN_FLAG) {
        $chk_abc = 0;
        $products = $_SESSION['cart']->get_products();
        for ($i=0; $i<sizeof($products); $i++) {
          if (substr($products[$i]['model'], 0, 3) == 'ABC_') {
            $chk_abc += 1;
          }
        }
        if ($chk_abc == 0) {
          // if no ABC then turn off module
          $this->enabled = false;
        }
      }
      // eof: only show if ABC product is in the cart
[/B]
      // CUSTOMIZE THIS SETTING FOR THE NUMBER OF ZONES NEEDED

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!