Announcement

Collapse
No announcement yet.

blocking purchases of selected products, based on location

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    blocking purchases of selected products, based on location

    I have some products which I am not able to ship abroad (because of an understanding with the supplier). Some products are ok and they can ship happily, others aren't.

    Is there any way I can filter the basket as soon as the purchaser gets to checkout and puts their country in?

    I know it would be neater if the site could recognise their country as they enter the store and filter out the products (or remove the add to basket button) before they get to add them to basket, but I would have not a clue how to start with that !

    any help appreciated.

    #2
    By weight is one method: Restricting product sales by country
    Peblaco

    Comment


      #3
      You can add a warning dialogue to these items that pops up when they try to add to cart. It will say something like "This can only be ordered from within the UK'". There will be an OK button to add to Cart and a Cancel button to abandon adding.

      It won't stop them lying about their country and adding-to cart anyway but they'll be warned early.

      Here's how:

      Note the name of the Layout you normally use for such items.

      Go to Design / Library / Layouts / Products, right click the appropriate Layout and choose Copy.

      Rename that copy to end in UK Only (Like Standard Layout Using CSS UK Only).

      Open that new layout and look fir the line (near the top):
      Code:
            <form method="post" action="<actinic:variable name="OnlineScriptURL" value="Shopping Cart Script URL" />" >
      Amend it to be:
      Code:
            <form method="post" action="<actinic:variable name="OnlineScriptURL" value="Shopping Cart Script URL" />" onsubmit="return confirm('This can only be ordered from within the UK')">
      Now use this alternative Layout for the products you wish to warn on.

      This could be extended to ask them their country from a drop-down list, save said country in a cookie and disable all further such products once the country is known but that's rather a big job.
      Norman - www.drillpine.biz
      Edinburgh, U K / Bitez, Turkey

      Comment


        #4
        You could use: http://www.maxmind.com/en/javascript to identify if the visitor is visiting from a UK IP address, then with an appropriate class surrounding each of your buy buttons, you could use some additional JS to set whether to display or not based on the IP being from the GB block.

        One of the issues with this thou is that it will only show the buy button to those actually in the UK, so those that might be in France but want delivery to the UK would not see the buy button.

        An idea none the less.

        Comment


          #5
          Here's the way that uses a cookie to remember their fist selection. Their response will be remembered for the rest of their session.

          It won't stop them lying about their country and adding-to cart anyway but they'll be warned early.

          Here's how:

          Note the name of the Layout you normally use for such items.

          Go to Design / Library / Layouts / Products, right click the appropriate Layout and choose Copy.

          Rename that copy to end in UK Only (Like Standard Layout Using CSS UK Only).

          Open that new layout and look fir the line (near the top):
          Code:
                <form method="post" action="<actinic:variable name="OnlineScriptURL" value="Shopping Cart Script URL" />" >
          Replace that line with:
          Code:
          <script type="text/javascript">
          function warnthem(){
          	var location = getCookie('ACT_LOCATION');
          	if ( location == null )	// need to find location
          		{
          		location = confirm('This can only be shipped to the UK.\nClick "OK" if you are in the UK, otherwise "Cancel"') ? 'UK' : 'NONUK';
          		setCookie('ACT_LOCATION', location);
          		return (location == 'UK');
          		}
          	if ( location == 'UK' ) return true;
          	alert('This can only be shipped to the UK');
          	return false;
          }
          </script>
                <form method="post" action="<actinic:variable name="OnlineScriptURL" value="Shopping Cart Script URL" />" onsubmit="return warnthem()">
          Now use this alternative Layout for the products you wish to warn on.
          Norman - www.drillpine.biz
          Edinburgh, U K / Bitez, Turkey

          Comment

          Working...
          X