Results 1 to 10 of 934

Hybrid View

  1. #1
    Join Date
    Sep 2005
    Location
    London
    Posts
    95
    Plugin Contributions
    0

    Default Re: New Royal Mail Modules

    I know, was on to the VAT people this morning following a customer's query. The VAT person made no bones about it - zero rate goods, zero rate delivery. Also if you look at Amazon, they don't charge VAT on delivery of books, but obviously do on anything else.

    Anyway, the safest bet for the time being is to offer free delivery on zero rate goods and charge normally for the rest.

    Thanks for reply anyway

  2. #2
    Join Date
    Nov 2006
    Location
    Papworth, Cambridgeshire, UK
    Posts
    731
    Plugin Contributions
    3

    Default Re: New Royal Mail Modules

    I'd suggest writing the VAT persons name down in a very prominent and accessible place, just in case. They tend to change their minds on such things.
    In a nutshell, Zen cart implements the concept of a shipping method based tax, rather than an individual product shipping tax, probably because Sales Tax rather than VAT is used in the USA.
    The shipping calc routines simply get a weight, from which they calculate a rate and apply any tax they have been told about. To change this cleanly, one would probably have to also pass the product tax rate in, and apply that instead as a quick and dirty. I'm sure there are more elegant ways to do it.

    Chuck

  3. #3
    Join Date
    Jan 2004
    Location
    UK
    Posts
    1,230
    Plugin Contributions
    0

    Default Re: New Royal Mail Modules

    Ok. I've discovered how to get this error to happen on a test shop, so for anyone who is using database-based caching and having the following errors:

    Warning: Variable passed to each() is not an array or object in ... ...
    and/or:

    Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at ...

    Warning: Cannot modify header information - headers already sent by (output started at ...

    1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'EXPECTED_PRODUCTS_SORT limit MAX_DISPLAY
    in:
    [select p.products_id, pd.products_name, products_date_available as date_expected from products p, products_description pd where p.products_id = pd.products_id and p.products_status = 1 and pd.language_id = '1' and p.products_date_available >=20070313 order by EXPECTED_PRODUCTS_FIELD EXPECTED_PRODUCTS_SORT limit MAX_DISPLAY_UPCOMING_PRODUCTS]
    when they install more than a few (typically 5+) Royal Mail modules in their shop, the following (hopefully) will explain what's happening, and why the SQL fix hasn't seemed to work.

    As Philip said in his bug report (see post #279 above) the above errors are being caused by the cache_data field in the db_cache table (in the database) not being big enough out-of-the-box to hold the increased data that the Royal Mail module(s) adds - each module adds a load of zone and shipping rate parameters, so the more modules you add, the bigger the stored data becomes until the storage capacity of the cache_data field is exceeded and the data that the shop is attempting to store there becomes corrupted.

    As Philip has said, typically your shop will be fine the first time you access it after installing the RM modules (or after enabling more of them in admin) as the parameters are read from the various tables in the database and stored for the first time in the db_cache table) but subsequent visits will give the error (when the corrupted cached data is then read from the db_cache table).

    The solution (again as Philip has said) is to either increase the size of that field from 'blob' to 'mediumblob' - either by editing the structure of the field in the db_cache table, or by running the SQL:

    PHP Code:
     ALTER TABLE db_cache CHANGE COLUMN cache_data cache_data MEDIUMBLOB NOT NULL 
    or, alternatively, to change to file-based caching (in your configure.php files) so the db_cache table isn't used.

    For those people who've already run the SQL to increase the field size to 'mediumblob' and still have the errors, this is is important step that's been missed so far:

    The db_cache table is still holding corrupted data - so even after you've ran the SQL, the corrupted data is still in the db_cache table and is being retrieved by the shop, and hence the errors still appear. You need to delete the row of cached data in the db_cache table.

    You can delete the row either by editing the db_cache table directly with PHPMyAdmin - it will typically look like this:

    PHP Code:
    cache_entry_name                           cache_data                cache_entry_created
    zc_cc21d2f64edffccfe06d12dd3327
    ...        (might appear blank)         1173818124 
    ( delete the table row beginning 'zc_...')

    or by changing (temporarily) to file-based caching by editing your includes/configure.php and admin/includes/configure.php and changing:

    PHP Code:
      define('SQL_CACHE_METHOD''database'); 
    to

    PHP Code:
      define('SQL_CACHE_METHOD''file'); 
    Then save both configure.php files and access your shop - the error should disappear. If you wish, you can then change both configure.php entries back to 'database' - providing you've first run the SQL, of course.

    If you change to file-based caching, check you have the correct path to your cache folder set in admin->configuration->sessions->session directory - it should look something like (your path will probably differ):
    /home/your server user name/public_html/cache
    @theflyingbeard (and anyone else who tried it): Apologies for giving you duff info in my post above (post #281) on what to change in your configure files - I was thinking of 'sessions' when I should have been thinking of 'cache'.

  4. #4
    Join Date
    Nov 2006
    Location
    Papworth, Cambridgeshire, UK
    Posts
    731
    Plugin Contributions
    3

    Default Re: New Royal Mail Modules

    Well done Pixxi.
    A cachet for your cache work!

    Chuck

  5. #5
    Join Date
    Mar 2007
    Posts
    19
    Plugin Contributions
    0

    Default Re: New Royal Mail Modules

    Brilliant. Thanks Pixxi.

    I changed to the file cacheing and that now works. I'll try the sql method when I'm feeling a bit braver.
    Great job thanks.
    TFB


    Chuckl
    Thanks for taking an interest. all sorted now.

  6. #6
    Join Date
    Sep 2005
    Location
    London
    Posts
    95
    Plugin Contributions
    0

    Default Re: New Royal Mail Modules

    Try as I might I can't get the RM modules to hide if Free Shipping is applied. Weights are set to zero, zones are not an issue and hide if invalid is set to true. Have I forgotten something or is this just something that the RM modules are not programmed to do?

    I am using the Freeshipper module not Freeshipping options module.

    Sorted out VAT question by the way which prompted my problem. Had a logged call to the VAT woman and it turns out that if delivery is invoiced on the same invoice as zero rated goods then delivery is also zero rated - delivery of any vatable goods on the same invoice as the zero rated goods have to have VAT apportioned. Its not too much of a problem, because we shall just include delivery in the price of the zero rated items.

  7. #7
    Join Date
    Sep 2005
    Location
    London
    Posts
    95
    Plugin Contributions
    0

    Default Re: New Royal Mail Modules

    Sort of half solved my problem. Have inserted:

    // disable only when entire cart is free shipping
    if (zen_get_shipping_enabled($this->code)) {
    $this->enabled = ((MODULE_SHIPPING_RM1STPACKET_STATUS == 'True') ? true : false);
    }

    but will only work if hide if invalid switch is off in relevant shipping module admin.

    Still good enough for me. Wish I knew what I was doing.

  8. #8
    Join Date
    Mar 2007
    Posts
    19
    Plugin Contributions
    0

    Default Big Royal Mail Modules not hiding when free shipping enabled. freeshipper module

    Hi all,
    Just a Note of interest regarding the hiding of RM Modules when using the Freeshipper module
    RE:
    Quote Originally Posted by TPHoare View Post
    Try as I might I can't get the RM modules to hide if Free Shipping is applied. Weights are set to zero, zones are not an issue and hide if invalid is set to true. Have I forgotten something or is this just something that the RM modules are not programmed to do?

    I am using the Freeshipper module not Freeshipping options module.
    Quote Originally Posted by TPHoare View Post
    Sort of half solved my problem. Have inserted:

    // disable only when entire cart is free shipping
    if (zen_get_shipping_enabled($this->code)) {
    $this->enabled = ((MODULE_SHIPPING_RM1STPACKET_STATUS == 'True') ? true : false);
    }

    but will only work if hide if invalid switch is off in relevant shipping module admin.

    Still good enough for me. Wish I knew what I was doing.
    I was having the same problem, but I have a slightly different solution that doesn't require the hide if invalid switch to be set to off.

    The freeshipper module allows you to set an item to "Always free shipping" and works by setting the weight for that item to zero. Unfortunately all the Big Royal Mail Modules give a shipping value to any weight that is less than or equal to 0.1Kg and increases the value according to the weight.

    On the plus side this means the Big Royal Mail Module will assign the minimum value to all products that do not have a weight.

    On the minus side it means that the Big Royal Mail Modules will not hide when the freeshipper module is used.

    The following solution will resolve the problem but it does require that you give every product either a weight or tick the "Always free shipping" option and have the freeshipper module installed. (best to give all products a weight anyway, even downloads, in case you later remove the freeshipper module)

    Failure to do so will result in the following error message at the checkout when a product with no weight AND not selected as always free shipping:

    TITLE_NO_SHIPPING_AVAILABLE
    TEXT_NO_SHIPPING_AVAILABLE

    OK so with that understood, each Big Royal Mail Module that you wish to use will need editing thus (but make a backup first just to be safe):

    1. Access the modules at includes\modules\shipping

    2. Edit the Big Royal Mail Module you wish to use (e.g. \includes\modules\shipping\rm2ndletter.php)

    3. Perform a search for "if ($total_weight <=" (without the " quotes)
    you should find the following lines in each module:


    Code:
     
            if ($total_weight <= $zones_table[$i]) {
              $this->enabled = true;
              break;
            }
          } // end of looping through
    4. insert the following code before the line: break;


    Code:
     
              // disable when entire cart is free shipping defined by total weight = 0 as initiated by freeshipper
              if ($total_weight <=0) {
                $this->enabled = ((MODULE_SHIPPING_xxxxxxxxxxx_STATUS == 'false') ? true : false);
              }
    5. Notice the xxxxxxxxxxx part. This needs to be changed to the name of the module you are editing.

    e.g. if you are editing rm2ndletter.php it should look like this: MODULE_SHIPPING_RM2NDLETTER_STATUS

    Remember to use UPPERCASE letters.

    6. save the file and upload it to includes\modules\shipping

    the finished code should look like this (assuming your editing rm2ndletter.php):


    Code:
     
            if ($total_weight <= $zones_table[$i]) {
              $this->enabled = true;
              // disable when entire cart is free shipping defined by total weight = 0 as initiated by freeshipper
              if ($total_weight <=0) {
                $this->enabled = ((MODULE_SHIPPING_RM2NDLETTER_STATUS == 'false') ? true : false);
              }
              break;
            }
          } // end of looping through

    That's it. I hope this is helpful, it works for me. If I've made any mistakes or anyone has another solution, I would be glad to hear it.

    TFB

 

 

Similar Threads

  1. Royal Mail Basic UK Shipping Modules
    By Chuckl in forum Addon Shipping Modules
    Replies: 168
    Last Post: 24 Sep 2013, 08:04 PM
  2. UK Royal mail
    By pasticheart in forum Built-in Shipping and Payment Modules
    Replies: 2
    Last Post: 19 Apr 2010, 02:38 PM
  3. Big Royal Mail Shipping Modules Mysteriously Stopped - Please Help
    By stevesubhub in forum Built-in Shipping and Payment Modules
    Replies: 0
    Last Post: 8 Oct 2009, 02:17 PM
  4. Royal Mail
    By SilverKop in forum Addon Shipping Modules
    Replies: 0
    Last Post: 20 Feb 2009, 01:26 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR