Forums / Discounts/Coupons, Gift Certificates, Newsletters, Ads / I want Normal Shipping Rules to apply when I ship Gift Cards

I want Normal Shipping Rules to apply when I ship Gift Cards

Started by avaadorn on 6 Jun 2015, 6:08 PM · Views: 2,228

Results 1 to 18 of 18
6 Jun 2015, 6:08 PM
#1
avaadorn avatar

avaadorn

Zen Follower

Join Date:
Feb 2012
Posts:
106
Plugin Contributions:
0

I want Normal Shipping Rules to apply when I ship Gift Cards

Hi, I'm selling a physical gift card on my site. I want to offer free shipping for standard shipping, but if a customer wants a gift card expedited, they should pay for that. So I set up my gift card as Product is NOT virtual and Normal Shipping Rules should apply. However, when I do that, I get the error: We are not shipping to your region at this time. Shouldn't my regular shipping options come up?

The only way I can allow someone to purchase a gift card is if I enable the free shipper. And then the shipping is free, but there is no way someone can expedite a gift card if they want that option. Am I overlooking something here? I would think the gift card should be treated just like a regular physical product.

6 Jun 2015, 6:26 PM
#2
ajeh avatar

ajeh

Oba-san

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

Re: I want Normal Shipping Rules to apply when I ship Gift Cards

What is this Product's model?

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!

6 Jun 2015, 6:41 PM
#3
avaadorn avatar

avaadorn

Zen Follower

Join Date:
Feb 2012
Posts:
106
Plugin Contributions:
0

Re: I want Normal Shipping Rules to apply when I ship Gift Cards

GIFT-2000, but it is priced by attribute so the attributes part number shows up in the shopping cart.

6 Jun 2015, 6:48 PM
#4
ajeh avatar

ajeh

Oba-san

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

Re: I want Normal Shipping Rules to apply when I ship Gift Cards

If you change the Product Model from GIFT-2000 to 2000-GIFT does this fix things for you?

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!

6 Jun 2015, 7:00 PM
#5
avaadorn avatar

avaadorn

Zen Follower

Join Date:
Feb 2012
Posts:
106
Plugin Contributions:
0

Re: I want Normal Shipping Rules to apply when I ship Gift Cards

Yes, it does! I guess it all had to do with the model number. Thanks, Ajeh!

6 Jun 2015, 7:04 PM
#6
ajeh avatar

ajeh

Oba-san

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

Re: I want Normal Shipping Rules to apply when I ship Gift Cards

You are most welcome ... thanks for the update that this worked for you ... :smile:

When the Product's model starts with GIFT it is always treated like a Gift Certificate that needs no shipping information. Providing the first 4 letters are not GIFT it will be treated like a regular 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!]
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!

7 Jun 2015, 9:43 PM
#7
avaadorn avatar

avaadorn

Zen Follower

Join Date:
Feb 2012
Posts:
106
Plugin Contributions:
0

Re: I want Normal Shipping Rules to apply when I ship Gift Cards

One problem I have now is that someone can use a promo code to purchase the gift card. Before when the model number began with GIFT, Discount Coupons could not be applied towards the purchase of Gift Certificates. How do I get around that?

8 Jun 2015, 1:26 AM
#8
ajeh avatar

ajeh

Oba-san

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

Re: I want Normal Shipping Rules to apply when I ship Gift Cards

On the Discount Coupon add the Gift Card to the restrictions so that it is set to DENY ...

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!

8 Jun 2015, 2:22 AM
#9
avaadorn avatar

avaadorn

Zen Follower

Join Date:
Feb 2012
Posts:
106
Plugin Contributions:
0

Re: I want Normal Shipping Rules to apply when I ship Gift Cards

Ajeh:

On the Discount Coupon add the Gift Card to the restrictions so that it is set to DENY ...

But I would have to add this to EVERY discount coupon that I have? Is there a way to make a global restriction?

8 Jun 2015, 1:13 PM
#10
ajeh avatar

ajeh

Oba-san

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

Re: I want Normal Shipping Rules to apply when I ship Gift Cards

You would need to add a record to for each Discount Coupon into the table:
coupon_restrict

for the restriction ...

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!

17 Jun 2015, 4:00 PM
#11
avaadorn avatar

avaadorn

Zen Follower

Join Date:
Feb 2012
Posts:
106
Plugin Contributions:
0

Re: I want Normal Shipping Rules to apply when I ship Gift Cards

Now there's the issue of Group Pricing. I don't want the group discount to be applied for the physical gift cards. Is there a way to add the restriction?

17 Jun 2015, 4:17 PM
#12
ajeh avatar

ajeh

Oba-san

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

Re: I want Normal Shipping Rules to apply when I ship Gift Cards

Have you an URL to these Physical Gift Cards that might give me an idea on how to do this?

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!

17 Jun 2015, 5:10 PM
#14
ajeh avatar

ajeh

Oba-san

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

Re: I want Normal Shipping Rules to apply when I ship Gift Cards

Edit the file:
/includes/classes/shopping_cart.php

and down near the bottom, add the code in RED:

    return $in_cart_check_qty;
  }
// eof: change $total_count for options_id/options_values_id combo

[B]//////////////////////////////////////////////////////////
// This in_cart_product_total_price function will need to be removed in future releases - it will be there in the core
/**
 * calculate products_id price in cart
 * USAGE:  $product_total_price = $this->in_cart_product_total_price(12);
 * USAGE:  $chk_product_cart_total_price = $_SESSION['cart']->in_cart_product_total_price(12);
 *
 * @param mixed $product_id
 */
  function in_cart_product_total_price($product_id) {
    $products = $this->get_products();
//echo '<pre>'; echo print_r($products); echo '</pre>';
    for ($i=0, $n=sizeof($products); $i<$n; $i++) {
      $productsName = $products[$i]['name'];
      $ppe = $products[$i]['final_price'];
      $ppt = $ppe * $products[$i]['quantity'];
      $productsPriceEach = $ppe + $products[$i]['onetime_charges'];
      $productsPriceTotal = $ppt + $products[$i]['onetime_charges'];
      if ((int)$product_id == (int)$products[$i]['id']) {
//        echo 'GOOD id: ' . $products[$i]['id'] . ' vs ' . ' $product_id: ' . $product_id . ' $products[$i][name]: ' . $products[$i]['name'] . ' $productsPriceEach: ' . $productsPriceEach . ' $productsPriceTotal: ' . $productsPriceTotal . '<br><br>';
        $in_cart_product_price += $productsPriceTotal;
      } else {
//        echo 'NOT GOOD id: ' . $products[$i]['id'] . ' vs ' . ' $product_id: ' . $product_id . ' $products[$i][name]: ' . $products[$i]['name'] . ' $productsPriceEach: ' . $productsPriceEach . ' $productsPriceTotal: ' . $productsPriceTotal . '<br><br>';
      }
    } // end FOR loop
    return $in_cart_product_price;
  }
// This in_cart_product_total_price function will need to be removed in future releases - it will be there in the core
//////////////////////////////////////////////////////////
[/B]
}

Next, edit the file and add the code in RED:
/includes/modules/order_total/ot_group_pricing.php

      $gift_vouchers = $_SESSION['cart']->gv_only();

[B]// bof: Custom snailmail GV no Group Discount
// change 370 to proper products_id
      $snail_gift_vouchers += $_SESSION['cart']->in_cart_product_total_price(370);
//echo '$snail_gift_vouchers: ' . $snail_gift_vouchers . '<br>';
      [/B][B]$discount = ($orderTotal['total'] - $gift_vouchers[/B][B] - $snail_gift_vouchers[/B][B]) * $group_discount->fields['group_percentage'] / 100;[/B][B]
// eof: Custom snailmail GV no Group Discount
[/B]
//      echo "discout = $discount<br>";
      $od_amount['total'] = round($discount, 2);
      $ratio = $od_amount['total']/$order_total;
      /**

Now see if this alters the Group Discount ... the 370 is the products_id for your Snail Mail Gift Certificate ...

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!

17 Jun 2015, 5:57 PM
#15
avaadorn avatar

avaadorn

Zen Follower

Join Date:
Feb 2012
Posts:
106
Plugin Contributions:
0

Re: I want Normal Shipping Rules to apply when I ship Gift Cards

In my /includes/classes/shopping_cart.php file, I don't have the same code that you have there:

return $in_cart_check_qty;

}
// eof: change $total_count for options_id/options_values_id combo

I am on version 1.39h. Perhaps that is why?

17 Jun 2015, 6:00 PM
#16
avaadorn avatar

avaadorn

Zen Follower

Join Date:
Feb 2012
Posts:
106
Plugin Contributions:
0

Re: I want Normal Shipping Rules to apply when I ship Gift Cards

Never mind. I was looking at the wrong file.

17 Jun 2015, 6:13 PM
#17
avaadorn avatar

avaadorn

Zen Follower

Join Date:
Feb 2012
Posts:
106
Plugin Contributions:
0

Re: I want Normal Shipping Rules to apply when I ship Gift Cards

Okay, changes are complete and now there is no group discount for snail mail cards. Thank you, Ajeh!

17 Jun 2015, 6:17 PM
#18
ajeh avatar

ajeh

Oba-san

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

Re: I want Normal Shipping Rules to apply when I ship Gift Cards

You are most welcome ... remember the Zen Cart Team when you are rich and famous! :cool:

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!