Forums / General Questions / v1.51 one-time charge added multiple times

v1.51 one-time charge added multiple times

Views: 930

Results 1 to 7 of 7
29 Oct 2013, 12:20 PM
#1
moesoap avatar

moesoap

Zen Follower

Join Date:
Mar 2010
Posts:
258
Plugin Contributions:
0

v1.51 one-time charge added multiple times

Hello.

In my product info page customers can order more than one size and one colour and add these products to cart. As my website is an embroidery business I am required to add a setup charge should the customer wish to have their logo digitised, which I am able to do using attributes. My problem is that when the customer selects, for example, Size - 10, 12, & 14 in Colours - Blue, White & Black and chooses one time setup charge, within the cart the customer is charged 3 times for setup. I have added screenshots to demonstrate the problem.

Attachment 13252Attachment 13253

From what I can gather there are 3 possible solutions...

  1. Add Setup Charge as a Product and direct customers to add this to cart separately :no:
  2. Allow customers to select Logo Digitising in the Shopping Cart and price could then be added to cart
  3. When customer clicks add to cart, redirect to custom page where customer selects personalisation options, then redirects to cart.

As I am not great with php options 2 and 3 would be beyond my capabilities. And as for option 1, it is a difficult task to ensure customers understand and follow that procedure.

Is there an option I am missing here? Or can anyone suggest a way to implement Options 2 or 3, from previous posts in the forum? Or am I looking at this completely wrong?

29 Oct 2013, 3:02 PM
#2
moesoap avatar

moesoap

Zen Follower

Join Date:
Mar 2010
Posts:
258
Plugin Contributions:
0

Re: v1.51 one-time charge added multiple times

Ok, I intend to add a custom option to the product info page. For example, The customer selects whether they require Logo Digitised or Text Only. The latter is Free but if they select logo it will cost £25.00. So to test this out I created a Session id and added it to product info display...

<?php
session_start();  
if(isset($_SESSION['setupcharge']))
    $_SESSION['setupcharge'] = $_SESSION['setupcharge'] = 25.00;

echo "Setup Charge = ". $_SESSION['setupcharge']; 
?>

I then added the following to tpl_shopping_cart_default.php around line 128...

<?php if(isset($_SESSION['setupcharge'])) {
$cartShowTotal += $_SESSION['setupcharge']; }
?>

But instead of adding the cost of the product and the new session id it is only displaying the custom $_SESSION['setupcharge], i.e. £25.00?

Why do they not add together?

31 Oct 2013, 11:35 AM
#3
moesoap avatar

moesoap

Zen Follower

Join Date:
Mar 2010
Posts:
258
Plugin Contributions:
0

Re: v1.51 one-time charge added multiple times

This one is beyond me. Unfortunately I have had to settle with an adaptation of this mod http://www.zen-cart.com/downloads.php?do=file&id=232

It's not how I would like it to be, but for the time being it will have to do. :dontgetit

31 Oct 2013, 11:49 AM
#4
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,732
Plugin Contributions:
56

Re: v1.51 one-time charge added multiple times

How about using the Low Order Fee module, but charge it for all orders (and change the language string defines to "Setup Charge" or something like that)?

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

31 Oct 2013, 12:32 PM
#5
moesoap avatar

moesoap

Zen Follower

Join Date:
Mar 2010
Posts:
258
Plugin Contributions:
0

Re: v1.51 one-time charge added multiple times

Thanks i'll give it a go now. Hopefully it is more suitable.

31 Oct 2013, 12:42 PM
#6
moesoap avatar

moesoap

Zen Follower

Join Date:
Mar 2010
Posts:
258
Plugin Contributions:
0

Re: v1.51 one-time charge added multiple times

The low order fee would work great if there was a way to differentiate between those orders that require setup and those that don't. With regards to the insurance mod it can be switched on or off, as per attached screenshot. The only downside is that it is just before confirm payment and not on product info page. So the chances of customers missing the setup charge before ordering is extremely high.

Attachment 13273

6 Apr 2014, 4:13 PM
#7
narata avatar

narata

New Zenner

Join Date:
Mar 2014
Location:
Florida
Posts:
6
Plugin Contributions:
0

Re: v1.51 one-time charge added multiple times

moesoap:

The low order fee would work great if there was a way to differentiate between those orders that require setup and those that don't. With regards to the insurance mod it can be switched on or off, as per attached screenshot. The only downside is that it is just before confirm payment and not on product info page. So the chances of customers missing the setup charge before ordering is extremely high.

Attachment 13273

I think this would work great for you.

Customize the following code in:
/includes/modules/order_total/ot_loworderfee.php

Install it in the Modules ... Order Totals ... and turn on:
Low Order Fee ot_loworderfee.php

and set it to Enable and the amount to: 10000

Then change the code from:
Code:
if (MODULE_ORDER_TOTAL_LOWORDERFEE_LOW_ORDER_FEE == 'true') {
switch (MODULE_ORDER_TOTAL_LOWORDERFEE_DESTINATION) {
case 'national':
if ($order->delivery['country_id'] == STORE_COUNTRY) $pass = true; break;
case 'international':
if ($order->delivery['country_id'] != STORE_COUNTRY) $pass = true; break;
case 'both':
$pass = true; break;
default:
$pass = false; break;
}
to read:
Code:
if (MODULE_ORDER_TOTAL_LOWORDERFEE_LOW_ORDER_FEE == 'true') {
switch (MODULE_ORDER_TOTAL_LOWORDERFEE_DESTINATION) {
case 'national':
if ($order->delivery['country_id'] == STORE_COUNTRY) $pass = true; break;
case 'international':
if ($order->delivery['country_id'] != STORE_COUNTRY) $pass = true; break;
case 'both':
$pass = true; break;
default:
$pass = false; break;
}

// bof: turn ON for Option ID 1 and Option Value ID 16
global $cart;
$cnt_attribute = 0;
$products = $_SESSION['cart']->get_products();
for ($i=0, $n=sizeof($products); $i<$n; $i++) {
if (isset($products[$i]['attributes']) && is_array($products[$i]['attributes'])) {
foreach ($products[$i]['attributes'] as $option => $value) {
// comment out echo when done testing
//echo 'I see: ' . $products[$i]['id'] . ' - ' . $option . ' - ' . $value . '<br>';
if ($option == 1 and $value == 16) {
$cnt_attribute += 1;
}
}
}
}
if ($cnt_attribute > 0) {
$pass = true;
} else {
$pass = false;
}

// eof: turn ON for Option ID 1 and Option Value ID 16
and just set the correct Option ID (currently set to 1) and Option Value ID (currently set to use 16) ... to your values ...

NOTE: you can then change the language file with your templates and overrides ...

I am in a similar boat. However, my set up fees are contingent upon the number of colors in the design (up to 7). If you only have a one time set up fee for $75, all you need to do is have the option on your product page. And it should work fine. Let me know if it works.

I'm still trying to look for my tweak to encompass all my option values, but I am not proficient in PHP.