Kryptronic Software Support Forum

You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.

#1 08-06-2015 19:31:28

Praxandros
Member
Registered: 07-24-2015
Posts: 17

Local Shipping in Cyprus

Hi there,

I am setting up an eshop which is intended to ship only in Cyprus.

The shipping tools in EuropaCart 8 are very helpful but in my case are not.

Which option should be selected if my customer prefers to use a local courier service?

Can I add cities/towns under Cyprus? If yes, how could I assign the cost for each destination?

Regards
Praxandros

Offline

 

#2 08-07-2015 09:54:47

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19798
Website

Re: Local Shipping in Cyprus

I would think you'd add areas to the states/provinces and assign them to Cyprus, and additionally edit all countries so that all but Cyprus are suppressed in both billing and shipping displays.  Then you can use a custom shipping script that uses state/province conditions (many can be found on the forum).


Nick Hendler

Offline

 

#3 08-10-2015 21:11:38

Praxandros
Member
Registered: 07-24-2015
Posts: 17

Re: Local Shipping in Cyprus

Hi Nick,

I have done what you suggested.

After that I have chosen a custom script and tried to alter it as follows but did not worked. It continue to take instructions from Strore-> Settings-> Shipping Settings
Could you please have a look and tell me what's wrong.
Regards

<?php

// +--
// | All custom shipping scripts work in the same way.  A global
// | variable named 'ecom.customship' contains the following PHP
// | array.  Array keys with value info:
// |
// | weight        => Total weight of items being shipped.
// | total         => Subtotal of items being shipped.
// | quantity      => Quantity of items being shipped.
// | stateprov     => Ship to state/province.
// | country       => Ship to country.
// | postalcode    => Ship to postal code.
// | rescom        => Ship to residential/commercial status.
// | shipstateprov => Ship origin state/province.
// | shipcountry   => Ship origin country.
// | shipzip       => Ship origin postal code.
// | packages      => An array containing all packages with
// |                  each package defined in it's own array
// |                  with keys: length, width, height, weight.
// | delinfo       => Delivery information array.
// | delitems      => An array containing all items with
// |                  each item id as a key and the item quantity
// |                  as a value.
// |
// | This script must set a global variable named
// | 'ecom.customship_response' which is an array in the
// | following format:
// |
// | method name => amount
// |
// | NOTE: Do not print anything within custom shipping
// | scripts.  They are designed only to return names and
// | prices for custom shipping methods.
// |
// | This script is a User Defined Calculation script that
// | returns a static method and amount.
// +--

$info   = $this->globals('ecom.customship');

if ($info['stateprov'] == 'Nicosia'){
$method   = 'Flat Rate';
$methodfree = 'FREE Shipping';

   if ($info['total'] < 100) {
    $custom = array($method => 5);
   }else{
    $custom = array($methodfree => 0);
   }


} elseif ($info['stateprov'] == 'Limassol' || $info['stateprov'] == 'Larnaca'){

   $method   = 'Flat Rate';
$methodfree = 'FREE Shipping';

   if ($info['total'] < 100) {
    $custom = array($method => 10);
   }else{
    $custom = array($methodfree => 0);
   }
   
} elseif ($info['stateprov'] == 'Paphos' || $info['stateprov'] == 'Famagusta'){

   $method   = 'Flat Rate';
$methodfree = 'FREE Shipping';

   if ($info['total'] < 100) {
    $custom = array($method => 15);
   }else{
    $custom = array($methodfree => 0);
   }

Last edited by Praxandros (08-10-2015 21:48:47)

Offline

 

#4 08-11-2015 06:24:35

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19798
Website

Re: Local Shipping in Cyprus

Add this to the end:

Code:

}
</php>

Nick Hendler

Offline

 

#5 08-11-2015 13:45:48

Praxandros
Member
Registered: 07-24-2015
Posts: 17

Re: Local Shipping in Cyprus

Hi Nick.
Thanks for your reply.
I have done the addition.

The software continues to act refusing the script.

Do I have to clear any cache?

Thanks

Offline

 

#6 08-12-2015 07:11:02

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19798
Website

Re: Local Shipping in Cyprus

I cleaned it up:

Code:

<?php

$info   = $this->globals('ecom.customship');
$custom = array();

if ($info['stateprov'] == 'Nicosia') {

     if   ($info['total'] < 100) {$custom = array('Flat Rate'     => 5);}
     else                        {$custom = array('FREE Shipping' => 0);}

} elseif ($info['stateprov'] == 'Limassol' || $info['stateprov'] == 'Larnaca') {

     if   ($info['total'] < 100) {$custom = array('Flat Rate'     => 10);}
     else                        {$custom = array('FREE Shipping' => 0);}
   
} elseif ($info['stateprov'] == 'Paphos' || $info['stateprov'] == 'Famagusta') {

     if   ($info['total'] < 100) {$custom = array('Flat Rate'     => 15);}
     else                        {$custom = array('FREE Shipping' => 0);}

} else {

     $custom = array('Shipping ERROR Please Call' => 999);

} // End of if statement.

$this->globals('ecom.customship_response',$custom);

?>

It was syntactically correct, however I missed that it was missing the all-important globalization of the custom array at the end:

Code:

$this->globals('ecom.customship_response',$custom);

Nick Hendler

Offline

 

#7 08-12-2015 07:12:44

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19798
Website

Re: Local Shipping in Cyprus

Be aware you really should have an else condition at the end that catches everything else (I added it above), otherwise an error will trigger if anything is being shipped anywhere other than the stateprovs you have conditions for.  By doing an else, you control the error text and amount from within the script.


Nick Hendler

Offline

 

#8 08-12-2015 12:08:51

Praxandros
Member
Registered: 07-24-2015
Posts: 17

Re: Local Shipping in Cyprus

Hi Nick,

Thank you very much.

Now it is working .

Regards Praxandros

Offline

 

Board footer