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 01-01-2021 09:50:49

Graham
Member
Registered: 09-30-2004
Posts: 958
Website

More checkout problems

Following my previous post about PayPal, I tried logging out of the account I was using, then attempted to do another transaction, intending to try a card payment.

Firstly when I tried to use Guest Checkout, I filled in all the relevant information, but the program returned me to the "Log in / select guest checkout" page.

When I clicked on the shopping cart (which has an item in it) and then on Checkout I got this message:

* * * * *

Script Execution Error

syntax error, unexpected '=>' (T_DOUBLE_ARROW)
File: /core/CORE_Display/CORE_Display.php(455) : eval()'d code Line: 66 Error Number: 256

* * * * *

I have also noticed that the core_guests database is empty.

It gives the top row as:

"    id     fname     lname     company     phone     addone     addtwo     city     stateprov     country     postalcode     rescom     acctsyspri     acctsysalt     acctsysprimod     acctsysaltmod"

but there's no data in it, despite my importing from the Europacart 8 installation.

Last edited by Graham (01-01-2021 10:01:20)

Offline

 

#2 01-01-2021 12:43:05

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

Re: More checkout problems

Sounds like an issue either with a custom sale script, custom surcharge script, or custom shipping script being run at checkout.  I guess you have all or some of those active and have a syntax error in your PHP code. 

As far as the core_guests table, expect it to be empty and remain empty.  It's used only to store guest customer info in the case the customer needs to be exported to an integrated accounting system like QuickBooks and the guest info needs to be maintained/preserved.


Nick Hendler

Offline

 

#3 01-01-2021 14:32:04

Graham
Member
Registered: 09-30-2004
Posts: 958
Website

Re: More checkout problems

I have a custom shipping script which was imported from v8 and which worked fine there.

Code:

<?php 

// +--
// |
// | ALP Custom Shipping UPDATED 2019-03-29 for free shipping 50 or more
// |
// | ALP Custom Shipping UPDATED 2018-01-27 for new long items
// |
// | 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 Percentage of Total Item Cost script that
// | returns a prices based on a percentage of the total item cost.
// +--


// * * * * * *

// In this section is the original custom shipping code 
// which is commented out

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

// $method          = 'Standard Carrier';
// $percent_of_cost = '10.00';

// $total = ($percent_of_cost / 100) * $info['total'];

// $custom = array($method => $total);

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

// * * * * * *


// Start of Affordable Leather Products Custom Shipping Code.

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

$method          = 'Standard Carrier';
$percent_of_cost = '10.00';


$uk_ship_meth_name_norm = 'UK Royal Mail';
$uk_ship_meth_name_spec = 'UK Special Delivery';
$uk_ship_meth_name_pf48 = 'Parcel Force 48';
$uk_ship_meth_name_ups = 'UPS';
$intl_ship_meth_name = 'International Delivery';
$ship_total = '0.00';
$ship_display = '';
$percentage = '0.00';
$uk_percentage = '10.000';
$intl_percentage = '20.000';
$ship_percentage = '0.00';
$item_total_weight = 0;
$item_length = 0;
$order_value = '0.00';

// Search package length to find the longest and store it in $item_length ???

     $length = 0;
     
     foreach ($packages as $packageid => $package) {if ($package['length'] > $length) {$length = $package['length'];}}

     $item_length = $length;

// Add 130 grammes to total weight to assume we
// include a catalogue and a K7 envelope.

$info['weight'] = ($info['weight'] + 130);

// Check if UK or International shipping.

if (($info['country'] == 'UK - England & Wales') || ($info['country'] == 'United Kingdom') || ($info['country'] == 'UK - Scotland Mainland') || ($info['country'] == 'UK - Highlands & Islands Scotland') || ($info['country'] == 'Isles Of Scilly') || ($info['country'] == 'UK - Isle of Man') || ($info['country'] == 'UK - Channel Islands') || ($info['country'] == 'UK - Northern Ireland')) {

// UK shipping routine.

// 
// First we check if the order total is over 60 
// pounds, if so, we use the Special Delivery rates.
// 

// We are now changing this so if the total is over 50, we ship for free

//
// OLD SPECIAL DELIVERY CODE COMMENTED OUT
//

// if ($info['total'] > 60) {

//   // Special Delivery shipping routine.

//   $ship_meth_name = $uk_ship_meth_name_spec;

//   // Start with a base cost of 7.25 pounds and work up.

//   $ship_total = 7.25;

//   if ($info['weight'] >= 500) {

//   $ship_total = 8.55;

//   } // End of if statement.

//   if ($info['weight'] >= 1000) {

//   $ship_total = 11.00;

//   } // End of if statement.

//   if ($info['weight'] >= 2000) {

//   // If items are over 2kg, send by Parcel Force 48.

//   $ship_meth_name = $uk_ship_meth_name_pf48;

//   // Changed ship_total below to 16.00 for new max shipping

//   $ship_total = 16.00;

//   } // End of if statement.

//   // End of Special Delivery Code.

// - END OF COMMENTED OUT OLD SPECIAL DELIVERY CODE


  
// NEW Code for FREE SHIPPING 50 + ???

if ($info['total'] >= 50) {

     // Free shipping cost of 0.00 pounds

     $ship_total = 0.00;

     // Check if weight is below 2000 grams. If so, we ship Royal Mail Small Parcel for FREE
     // otherwise we ship UPS for Free
     
          if ($info['weight'] <= 2000) {

          $ship_meth_name = $uk_ship_meth_name_norm;
       
          } else {
  
          $ship_meth_name = $uk_ship_meth_name_ups;

          }
     
// END of NEW Code for FREE SHIPPING 50+
    
} else {

  // Cost of item is below 50 so we use the NORMAL DELIVERY shipping routine

  $ship_meth_name = $uk_ship_meth_name_norm;

  //
  // Figure out what the normal shipping charge will be according to the weight.
  //

  // Start with a base cost of 3.50 

  $ship_total = 3.50;

     // Check to see if we have a Medium Parcel, if so, we charge 5.50
  
     if ($item_length >= 45) {
     
          $ship_total = 5.50;
     
     } // End of if statement.
     
} // End of if statement.

  // 
  // In here we add the BIRTHDAY code
  // NB Currently disabled as we don't know how to check
  // what Discount Code has been used.

//  if ($tracking_discountcode == 'BIRTHDAY') {

//  $ship_total = 0.00;

//  } // End of if statement.

  // 
  // END OF BIRTHDAY CODE.
  // 

  // 
  // Add a check to make sure that we're not charging
  // more than the standard 10% shipping!
  // 

  // $percentage = ($uk_percentage / 100);

  // $ship_percentage = ($info['total'] * $percentage);

  //
  // Figure out what the shipping charge will be by
  // multiplying the percentage by the subtotal.
  //

  // if ($ship_total > $ship_percentage) {

  // $ship_total = $ship_percentage;

  // } // End of if statement.

// Check we're not charging P&P on a Free Catalogue

$order_value = $info['total'];

if ($order_value == 0) {

$ship_total = 0.00;

} // End of if statement.

// Check we're not charging 2.20 P&P on a Catalogue and Cuffs or Voucher

// $order_value = $info['total'];

// if ($order_value == 5.00) {

// $ship_total = 0.50;

// } // End of if statement.

  // 
  // MAXIMUM UK P&P IS 16 POUNDS
  // 

//  if ($ship_total > 16) {

//  $ship_total = 16.00;

//  } // End of if statement.

// End of UK shipping routine

} else {

// International shipping

// NB WE MAY BE ABLE TO CHANGE THIS TO PARCEL FORCE WORLDWIDE RATES

$ship_meth_name = $intl_ship_meth_name;
$percentage = $intl_percentage;

//
// Figure out what the international shipping 
// charge will be by multiplying the percentage
// by the subtotal.
// 

$percentage = ($percentage / 100);

$ship_total = ($info['total'] * $percentage);

// Minimum international P&P is 5.60

  if ($ship_total < 5.60) {

  $ship_total = 5.60;

  } // End of if statement.

} // End of if statement.

//
// Add Gift Certificate Code - Check if weight < 5g, if so we don't charge
// for P&P
//

if ($info['weight'] < 5) {

$ship_meth_name = $uk_ship_meth_name_norm;
$ship_total = 0;

}  // End of if statement.

// Add code for free shipping for wholesale if cost of order is over 250 
// ???

$custinfo = $this->globals('core_user.usergroup');

if (($custinfo == 'wholesale') && ($info['total'] >= 250)) {

  $method = 'Free Shipping';
  $ship_total = 0;
  $total = 0;

} // End of if statement.

$method = $ship_meth_name;
$total = $ship_total;

// End of Affordable Leather Products Custom Shipping Code.

$custom = array($method => $total);

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

?>

Offline

 

#4 01-01-2021 21:11:10

Graham
Member
Registered: 09-30-2004
Posts: 958
Website

Re: More checkout problems

As per my other thread, I just re-installed and then had to re-import my data and re-upload the program files and product and category databases to get this working.

Offline

 

Board footer