close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Free Shipping option for product category if it's the only one in the cart (flat rate cart)

Thread began 12/16/2013 2:02 pm by sublucent | Last modified 12/17/2013 7:52 am by sublucent | 1295 views | 5 replies

sublucentBeta Tester

Free Shipping option for product category if it's the only one in the cart (flat rate cart)

I dug through the forums but couldn't piece together what I needed.

The cart that I've setup is flat rate shipping for the whole cart with a drop down to pick between store pickup (free), domestic, domestic express international, and international express, so no weights are used. Now we have added gift cards to the store. The gift cards are in their own category (from a relational table). I've bound the category ID to the WA eCart AddToCart. The gift cards will be emailed so they need to be free shipping if gift cards are the only products in the cart.

The current shipping rules use session variables set from the shipping option drop down menu in the cart. I created a new rule for the gift cards using the trigger condition "Number of items with a specific column value" where Category of 52 (the category ID for gift cards) is > 0. It seems that I now need to add another trigger that checks the cart for any items that are not from Category 52 so it will use the other shipping rules and not make the whole cart free shipping. I haven't been able to figure out how to do this.

Thanks for you time!

php:
//eCart Rule

function WAEC_yoCart_USPS()  {
  $totalShipping = 0;
  if (true && (((isset($_SESSION['eCartCheckoutForm_shipping_country'])?$_SESSION['eCartCheckoutForm_shipping_country']:"") == "US") && ((isset($_SESSION['eCartCheckoutForm_shipping_method'])?$_SESSION['eCartCheckoutForm_shipping_method']:"") == "Standard"))) {
    $totalShipping += 6;//Result
  }
  return WA_eCart_FormatNumber($totalShipping, $this->ForceDecimalsC, $this->DecimalPlacesC);
}
//eCart Rule
//eCart Rule
function WAEC_yoCart_DomesticExpress()  {
  $totalShipping = 0;
  if (true && (((isset($_SESSION['eCartCheckoutForm_shipping_country'])?$_SESSION['eCartCheckoutForm_shipping_country']:"") == "US") && ((isset($_SESSION['eCartCheckoutForm_shipping_method'])?$_SESSION['eCartCheckoutForm_shipping_method']:"") == "Express"))) {
    $totalShipping += 50;//Result
  }
  return WA_eCart_FormatNumber($totalShipping, $this->ForceDecimalsC, $this->DecimalPlacesC);
}
//eCart Rule
//eCart Rule
function WAEC_yoCart_International()  {
  $totalShipping = 0;
  if (true && (((isset($_SESSION['eCartCheckoutForm_shipping_country'])?$_SESSION['eCartCheckoutForm_shipping_country']:"") != "US") && ((isset($_SESSION['eCartCheckoutForm_shipping_country'])?$_SESSION['eCartCheckoutForm_shipping_country']:"") != "") && ((isset($_SESSION['eCartCheckoutForm_shipping_method'])?$_SESSION['eCartCheckoutForm_shipping_method']:"") == "Standard"))) {
    $totalShipping += 18;//Result
  }
  return WA_eCart_FormatNumber($totalShipping, $this->ForceDecimalsC, $this->DecimalPlacesC);
}
//eCart Rule
//eCart Rule
function WAEC_yoCart_InternationalExpress()  {
  $totalShipping = 0;
  if (true && (((isset($_SESSION['eCartCheckoutForm_shipping_country'])?$_SESSION['eCartCheckoutForm_shipping_country']:"") != "US") && ((isset($_SESSION['eCartCheckoutForm_shipping_country'])?$_SESSION['eCartCheckoutForm_shipping_country']:"") != "") && ((isset($_SESSION['eCartCheckoutForm_shipping_method'])?$_SESSION['eCartCheckoutForm_shipping_method']:"") == "Express"))) {
    $totalShipping += 50;//Result
  }
  return WA_eCart_FormatNumber($totalShipping, $this->ForceDecimalsC, $this->DecimalPlacesC);
}
//eCart Rule
//eCart Rule
function WAEC_yoCart_EmptyShipping()  {
  $totalShipping = 0;
  if (true && (((isset($_SESSION['eCartCheckoutForm_shipping_country'])?$_SESSION['eCartCheckoutForm_shipping_country']:"") == ""))) {
    $totalShipping += 0;//Result
  }
  return WA_eCart_FormatNumber($totalShipping, $this->ForceDecimalsC, $this->DecimalPlacesC);
}
//eCart Rule
//eCart Rule
function WAEC_yoCart_StorePickup()  {
  $totalShipping = 0;
  if (true && (((isset($_SESSION['eCartCheckoutForm_shipping_method'])?$_SESSION['eCartCheckoutForm_shipping_method']:"") == "Store Pickup"))) {
    $totalShipping += 0;//Result
  }
  return WA_eCart_FormatNumber($totalShipping, $this->ForceDecimalsC, $this->DecimalPlacesC);
}
//eCart Rule
//eCart Rule
function WAEC_yoCart_GiftCertificate()  {
  $totalShipping = 0;
  if (true && (($this->ConditionalTotal("Quantity", "Category", "52") > 0))) {
    $totalShipping += 0;//Result
  }
  return WA_eCart_FormatNumber($totalShipping, $this->ForceDecimalsC, $this->DecimalPlacesC);
}
//eCart Rule

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...