If this is your first visit, check our documentation. To post, register or login.
Forums / Community Contributed Add-Ons / Addon Shipping Modules / Some products being made available in Europe on UK website

Some products being made available in Europe on UK website

Started by dharrison on 11 Jun 2013, 3:27 PM · Views: 1,493

Results 1 to 17 of 17
11 Jun 2013, 3:27 PM
#1
dharrison avatar

dharrison

Zen Follower

Join Date:
Mar 2009
Location:
Essex, UK
Posts:
448
Plugin Contributions:
0

Post #1 by dharrison

Hi

Our office furniture website is currently set up for clients in the UK. As they are cheaper the more units you buy, I have had to implement the Product Price Manager to set up the Unit Cost.

We would like to make some of our desk frames available to Europe as well, but these will only be available per unit instead of the bulk offer that we have with the UK. I have been racking my brains for a few days now and think the only practical way of doing this is to set up a new category for European goods.

My question is, can I set up the shipping/ available countries a particular category? Is this a practical setup or can anyone think of a better way.

Any help as always will be gratefully received.

Thanks in advance.

Debbie Harrison
DVH Design | Web Design blog

11 Jun 2013, 4:34 PM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

Post #2 by drbyte

Are you saying that you want to disable Quantity Discounts based on the geographic zone to which the customer is shipping?

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

12 Jun 2013, 6:09 AM
#3
dharrison avatar

dharrison

Zen Follower

Join Date:
Mar 2009
Location:
Essex, UK
Posts:
448
Plugin Contributions:
0

Post #3 by dharrison

DrByte:

Are you saying that you want to disable Quantity Discounts based on the geographic zone to which the customer is shipping?

Quantity discounts for our products are set up for the UK but we are looking to deliver single frame units to Europe. If disabling is the option then yes, but I am wondering if it would just be easier to create a separate category called desk frames and make that available to Europe.

But I don't even know if it is possible to set up a category with different shipping and coverage or have a certain option on the existing product, and this is what I am seeking advice on.

Debbie Harrison
DVH Design | Web Design blog

12 Jun 2013, 4:32 PM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

Post #4 by drbyte

Some possible options (there may be others):

a) Create new categories and new products without qty discounts set on them. This may be confusing to customers, especially if they're duplicates of other products that do have discounts.

b) Write custom code to not display (or calculate) the qty discounts on any products if the customer is logged in and has selected a shipping zone outside the UK (since that's what you said is your primary area where discounts do apply).
This will be less confusing to customers, especially if you also add text to the template saying that discounts are only relevant in the UK.
The custom code would need to not only prevent display from within your template, but also prevent the calculation within the shopping cart and order classes.
Caveat: You might have to do even more custom coding if you wanted all this logic to only activate on "certain products" instead of universally across your store.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

12 Jun 2013, 6:33 PM
#5
dharrison avatar

dharrison

Zen Follower

Join Date:
Mar 2009
Location:
Essex, UK
Posts:
448
Plugin Contributions:
0

Post #5 by dharrison

DrByte:

Some possible options (there may be others):
b) Write custom code to not display (or calculate) the qty discounts on any products if the customer is logged in and has selected a shipping zone outside the UK (since that's what you said is your primary area where discounts do apply).
This will be less confusing to customers, especially if you also add text to the template saying that discounts are only relevant in the UK.
The custom code would need to not only prevent display from within your template, but also prevent the calculation within the shopping cart and order classes.
Caveat: You might have to do even more custom coding if you wanted all this logic to only activate on "certain products" instead of universally across your store.

I'm all for option 2 or 3. The only thing is it will be only for selected products (desk frames rather than complete desks). I can do basic coding and follow patterns of code, so please could I ask what custom code I should add (and where).

Many thanks :cool:

Debbie Harrison
DVH Design | Web Design blog

14 Jun 2013, 7:50 AM
#6
dharrison avatar

dharrison

Zen Follower

Join Date:
Mar 2009
Location:
Essex, UK
Posts:
448
Plugin Contributions:
0

Post #6 by dharrison

Actually, Option 3 is much more preferable. Please DrByte (or anyone else that knows) I would very much appreciate it if you could inform me of the code I would need to add to the website and where.

Thanking you in advance.

Debbie Harrison
DVH Design | Web Design blog

14 Jun 2013, 3:09 PM
#7
ajeh avatar

ajeh

Oba-san

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

Post #7 by ajeh

Grandma's billing address is in the UK and she is shipping to herself in the UK ... does this mean she DOES get the discount quantities?

Grandma's billing address is in the UK but she is shipping to little Tiny Tim in France ... does this mean she DOES NOT get the discount quantities?

Little Tiny Tim's billing address is in France and he is shipping to himself in France ... does this mean he DOES NOT get the discount quantities?

Little Tiny Tim's billing address is in France but he is shipping to Grandma in the UK ... does this mean he DOES get the discount quantities?

If Tiny Tim's customer address, billing address and shipping address is in France can he order quantity 6 of a chair (or what ever you are selling) but not get the quantity discount?

If Tiny Tim then changes the shipping address to Grandma's in the UK should he now get the quantity discount?

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!

15 Jun 2013, 10:28 AM
#8
dharrison avatar

dharrison

Zen Follower

Join Date:
Mar 2009
Location:
Essex, UK
Posts:
448
Plugin Contributions:
0

Post #8 by dharrison

Hi Ajeh

Yes basically, with the shipping caculated as well. Although its very unlikely that European users are going to order our items in bulk. I should point out its both a B2B and a B2C company

Debbie Harrison
DVH Design | Web Design blog

15 Jun 2013, 3:46 PM
#9
ajeh avatar

ajeh

Oba-san

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

Post #9 by ajeh

I hunted through the code and possible changes for this and found a way to make this happen if the idea is only those with a shipping address with the country_id of 222 is what you want to be able to have the discount quantities ...

1 Guests would NOT see the discount quantities when added to the cart (this could be done so that they can, but I have not looked to see if that complicates things)

2 Discount quantities would initially show if the customer's default address is countries_id 222

3 When the shipping address is changed either to countries_id 222 or another country on the checkout_shipping a message will show on the checkout_payment page saying discounts available/not available

There are quite a few steps to this, so I hope not to mess up the first time listing them ...

Edit the file:
/includes/modules/pages/login/header_php.php

and add the code in RED around line 85:

        $_SESSION['customer_country_id'] = $check_country->fields['entry_country_id'];
        $_SESSION['customer_zone_id'] = $check_country->fields['entry_zone_id'];

[B]// bof: set shipping country for discount quantity
$_SESSION['ship_to_customer_country_id'] = $check_country->fields['entry_country_id'];
// eof: set shipping country for discount quantity
[/B]
        $sql = "UPDATE " . TABLE_CUSTOMERS_INFO . "

Edit the file:
/includes/functions/functions_prices.php

and edit the code for the function zen_get_products_discount_price_qty and add the code in RED:

      $display_specials_price = zen_get_products_special_price($product_id, true);

      switch ($products_query->fields['products_discount_type']) {
[B]// bof: set shipping country for discount quantity
        case ($_SESSION['ship_to_customer_country_id'] != 222):
          //no discount applies
          $discounted_price = zen_get_products_actual_price($product_id);
          break;
// eof: set shipping country for discount quantity
[/B]        // none
        case ($products_discounts_query->EOF):

Edit the file:
/includes/modules/pages/checkout_shipping/header_php.php

and add the code in RED:

  require(DIR_WS_CLASSES . 'order.php');
  $order = new order;

[B]// bof: set shipping country for discount quantity
$_SESSION['ship_to_customer_country_id'] = $order->delivery['country_id'];
if ($_SESSION['ship_to_customer_country_id'] !=222) {
  // not company for discount
  $messageStack->add_session('checkout_payment', 'DISCOUNTS NOT VALID FOR SHIPPING DESTINATION', 'caution');
} else {
  $messageStack->add_session('checkout_payment', 'DISCOUNTS ARE VALID FOR SHIPPING DESTINATION', 'success');
}
// eof: set shipping country for discount quantity
[/B]
// register a random ID in the session to check throughout the checkout procedure

I would then, using your templates and overrides, edit the code for:
/includes/templates/template_default/templates/tpl_modulesproducts_quantity_discounts.php

<?php
  if ($disc_cnt < $columnCount) {
[B]// bof: set shipping country for discount quantity[/B]
?>
    <td align="center" colspan="<?php echo ($columnCount+1 - $disc_cnt)+1; ?>">[B]<span class="alert">DISCOUNTS FOR UK SHIPPING ONLY[/B]   [B]</span>[/B]</td>
<?php } [B]// eof: set shipping country for discount quantity[/B] ?>
    </tr>
<?php
  if (zen_has_product_attributes($products_id_current)) {
?>
    <tr>

In theory, this will allow Discount Quantities for ALL Products only for the UK country_id 222 ... and as the shipping address is changed in the checkout_shipping, or if the customer logs in to an account with the Primary address as the UK, it will switch it on/off ...

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!

15 Jun 2013, 4:31 PM
#10
ajeh avatar

ajeh

Oba-san

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

Post #10 by ajeh

NOTE: To not see any message about Discount Quantities on the checkout_payment when no Products are in the cart that use Discount Quantities, you can change the code a little for the file:
/includes/modules/pages/checkout_shipping/header_php.php

// bof: set shipping country for discount quantity
$_SESSION['ship_to_customer_country_id'] = $order->delivery['country_id'];
[B]if ($_SESSION['cart']->in_cart_check('products_discount_type') > 0) {[/B]
  if ($_SESSION['ship_to_customer_country_id'] !=222) {
    // not company for discount
    $messageStack->add_session('checkout_payment', 'DISCOUNTS NOT VALID FOR SHIPPING DESTINATION', 'caution');
  } else {
    $messageStack->add_session('checkout_payment', 'DISCOUNTS ARE VALID FOR SHIPPING DESTINATION', 'success');
  }
[B]}[/B]
// eof: set shipping country for discount quantity

and now the message will only show if a Product with possible Discount Quantities are in the order during checkout ...

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!

24 Jun 2013, 9:21 PM
#11
dharrison avatar

dharrison

Zen Follower

Join Date:
Mar 2009
Location:
Essex, UK
Posts:
448
Plugin Contributions:
0

Post #11 by dharrison

Thanks Ajeh

I haven't made any decision yet but, if the products available for Europe only were set up in a separate category, how could I restrict these so only european visitors could buy these. i.e. disabled for UK clients? Please advise.

Thanks for your help.

Debbie Harrison
DVH Design | Web Design blog

25 Jun 2013, 3:07 AM
#12
ajeh avatar

ajeh

Oba-san

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

Post #12 by ajeh

What happens if Grandma over in europe wants to send Tiny Tim over in the UK something ... or vise versa?

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!

25 Jun 2013, 5:59 AM
#13
dharrison avatar

dharrison

Zen Follower

Join Date:
Mar 2009
Location:
Essex, UK
Posts:
448
Plugin Contributions:
0

Post #13 by dharrison

Ajeh:

What happens if Grandma over in europe wants to send Tiny Tim over in the UK something ... or vise versa?

Just thinking that the category is marked (Europe only)

It is only some of the products that are available for Europe. The shipping for the entire furniture range would cost more than the actual product!

Is there a way to set a product so its restricted to the Euro zone (which is now set up?)

Debbie Harrison
DVH Design | Web Design blog

25 Jun 2013, 6:12 AM
#14
dharrison avatar

dharrison

Zen Follower

Join Date:
Mar 2009
Location:
Essex, UK
Posts:
448
Plugin Contributions:
0

Post #14 by dharrison

To elaborate, the setup from post #9 but instead of showing the Discount quantities when the customer's default address is countries_id 222, restricting the visitor of that category who's shipping address is countries_id 222. :smile:

Debbie Harrison
DVH Design | Web Design blog

11 Jul 2013, 11:07 PM
#15
ajeh avatar

ajeh

Oba-san

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

Post #15 by ajeh

Did you ever try my solution in post #9 to see if this managed your shipping issues for these Products that do not qualify for Product Quantity Discounts when going to outside of countries_id 222 ...

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!

12 Jul 2013, 5:58 AM
#16
dharrison avatar

dharrison

Zen Follower

Join Date:
Mar 2009
Location:
Essex, UK
Posts:
448
Plugin Contributions:
0

Post #16 by dharrison

Hi Ajeh

Thanks for checking up on us. :) The manager opted for a category marked 'Europe only' for the frames. He's also included the product quantity discounts on this category.

At the moment shipping is uk only on the other categories. Now its just a case of making shipping available to Europe. I would be very grateful to you if you could shed some light on how I could do that?

Debbie Harrison
DVH Design | Web Design blog

12 Jul 2013, 1:21 PM
#17
ajeh avatar

ajeh

Oba-san

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

Post #17 by ajeh

What shipping method(s) are you using?

What do you want to use for europe?

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!