Limit the number of payment options depending on the chosen shipping method. For example When a customer chooses pickup at store he should be able to select cash on pickup or money-order and when he chooses flat rate shipping he should be able to select cash on delivery or moneyorder.

Installation

New install

  1. If you have any versions prior to v1.9.0 installed, please check the upgrade tab for instructions
  2. Un-zip the package to a folder on your computer
  3. Rename the folder "YOUR_ADMIN" to your actual admin folder name.
  4. Copy all files & folders to your server. Below is a list of the files.
  5. Open the file /includes/classes/payment.php
    When using Zen Cart 1.5.6c You can skip this step and use the file provided in the folder "Core file overrides"
    Find the following line: (about line #29)
    $this->modules = explode(';', MODULE_PAYMENT_INSTALLED);
    replace that single line with:
    /* BOF Ship2pay 1 of 2 */
    require (DIR_WS_CLASSES . 'ship2pay.php');
    $my_ship2pay = new ship2pay;
    $arrship = explode('_', $_SESSION['shipping']['id']);
    $ship2pay_mods = $my_ship2pay->get_pay_modules($arrship[0]);
    if (zen_not_null($ship2pay_mods)) {
      $this->modules = explode(';', $ship2pay_mods);
    } else {
      /* EOF ship2pay 1 of 2 */
      $this->modules = explode(';', MODULE_PAYMENT_INSTALLED);
      /* BOF Ship2pay 2 of 2 */
    }
    /* EOF ship2pay 2 of 2 */

Upgrade

Use the list of files in the installation tab for comparison with your current installation, to see if any files have been added, or removed formthe package.
The easiest way is to use a file comparison program like Beyond Compare, or Winmerge.

Un-install

  • Delete all the files from your server. Use the file list as your guid to see which files to delete.
  • Run the uninstall.sql in "Tools => Install SQL Patches" of your Zen Cart admin panel

File List

Version 1.8.0 Version 1.9.0 Status
1 New files 1 New files
includes includes
│├ classes │├ classes
││└ship2pay.php <CC> ││└ship2pay.php Updated
│└ extra_datafiles │└ extra_datafiles
│ └ship2pay_database_names.php <CC> │ └ship2pay_database_names.php
YOUR_ADMIN YOUR_ADMIN
 ├ includes  ├ includes
 ││  │├ auto_loaders
 ││   ││└config.ship2pay.php New
 │├ classes  │├ classes
 ││├ship2pay_payment.php <CC>  ││├ship2pay_payment.php Updated
 ││└ship2pay_shipping.php <CC>  ││└ship2pay_shipping.php Updated
 │├ extra_datafiles  │├ extra_datafiles
 ││├ship2pay_database_names.php <CC>  ││├ship2pay_database_names.php
 ││└ship2pay_filenames.php <CC>  ││└ship2pay_filenames.php
 ││  │├ init_includes
 ││   ││└init_ship2pay.php New
 ││  │├ installers
 ││   ││└ ship2pay
 ││    ││ ├1_8_0.php New
 ││    ││ └1_9_0.php New
 │└ languages  │└ languages
 │ ├ dutch  │ ├ dutch
 │ │├ extra_definitions  │ │├ extra_definitions
 │ ││└ship2pay.php <CC>  │ ││└ship2pay.php
 │ │└ship2pay.php <CC>  │ │└ship2pay.php Updated
 │ └ english  │ └ english
 │  ├ extra_definitions  │  ├ extra_definitions
 │  │└ship2pay.php <CC>  │  │└ship2pay.php
 │  └ship2pay.php <CC>  │  └ship2pay.php Updated
 └ship2pay.php <CC>  └ship2pay.php Updated
2 Core file overrides 2 Core file overrides
includes includes
 └ classes  └ classes
  └payment.php <CC>   └payment.php Updated

Configuring Ship2pay

  • After installation, go to the admin > modules and click on ship 2 pay
  • Insert your links between shipping and payment.

If you don't specify any link, the code will work as before.

Version History

Version:   1.9
Release Date:   5-11-2019
Zen Cart Versions:   1.5.6
Author:   Zen4All
Changes:  
  • Updated: "includes\classes\payment.php" to Zen Cart 1.5.6c, and added better comment
  • Updated: "YOUR_ADMIN\includes\classes\ship2pay.php" to use foreach instead of while
  • Updated: "YOUR_ADMIN\includes\classes\ship2pay_payment.php" minor changes
  • Updated: "YOUR_ADMIN\includes\classes\ship2pay_shipping.php" minor changes
  • Updated: "YOUR_ADMIN\includes\languages\dutch\ship2pay.php" Improved translation
  • Updated: "YOUR_ADMIN\includes\languages\english\ship2pay.php" Improved translation
  • Updated: "YOUR_ADMIN\ship2pay.php" Major overhaul. Improved styling, making use of bootstrap. Code clean-up
  • Added auto-installer for datbase edits

Version:   1.8
Release Date:   13-07-2017
Zen Cart Versions:   tested on: Zen Cart 1.5.5, but should work on all 1.5.x distributions.
Author:   Zen4All
Changes:  
  • Fixed bug in install.sql
  • Updated files to be compatible with php 7.0
  • Removed Polish language files, because I am not able to provide support for them.
  • Updated control panel file
  • Added Zen Cart 1.5.5e overwrite file for "includes/classes/payment.php"

Version:   1.7
Release Date:   24-06-2014
Zen Cart Versions:   tested on: Zen Cart 1.5.x
Author:   Zen4All
Changes:  
  • Admin language files have been updated, to prevent the module title form showing up in other locations then this module
  • changed: YOUR_ADMIN/includes/languages/YOUR_LANGUAGE/extra_definitions/ship2pay.php
  • added: YOUR_ADMIN/includes/languages/YOUR_LANGUAGE/extra_definitions/ship2pay.php

Version:   1.6
Release Date:   02-05-2014
Zen Cart Versions:   tested on: Zen Cart 1.5.x
Author:   Zen4All
Changes:  
  • added: datafiles for database
  • added: datafiles for filenames
  • removed: unused variables $language, $PHP_SELF,$shipment,$GLOBALS from /includes/classes/ship2pay.php
  • removed: admin/image/icons/icon_status_green_light.gif It was not used in this module. instead the default present admin/image/icon_status_green_light.gif is used)
  • renamed: /admin/includes/classes/shipping.php to /admin/includes/classes/ship2pay_shipping.php
    /admin/includes/classes/payment.php to /admin/includes/classes/ship2pay_payment.php
    this way it is easier to spot module specific files
  • updated: admin/ship2pay.php code cleaning so it is up to Zen Cart 1.5.1 standard
  • updated: install.sql A statement was added so a link is added to the Modules menu
  • updated: installation instructions

Version:   1.5.2
Release Date:   1-11-2012
Zen Cart Versions:   tested on: Zen Cart Version 1.3.9h
Author:   fdeboer
Changes:  
  • added: dutch language definitions
  • fixed: obsolete $HTTP_GET/POST_VARS with $_GET/_POST
  • fixed: admin button image links
  • modified: moved language file to extra_definitions folder and merged manual language definitions from install into the language file.

Version:   1.5.1
Release Date:   19-07-2008
Zen Cart Versions:   1.3.8
Author:   wladimirec
Changes:  
  • fixed: undefined function calling in:
    /admin/includes/classes/shipping.php
    /admin/includes/classes/payment.php

Version:   1.5
Release Date:   27-06-2008
Zen Cart Versions:   1.3.8
Author:   wladimirec
Changes:   based on : osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 Edwin Bekaert (edwin@ednique.com)
  • modified to zen cart distribution by wladimirec
  • Included English and Polish language.
  • License: GPL 2.0 as per included LICENSE