Zen Cart Logo

minimum amount

Views: 10,015

Results 21 to 40 of 59
21 Jan 2011, 8:36 AM
#21
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

minimum amount

You're a bit of a magician with PHP, Ajeh. I wonder if you could recommend a good book that will start off at foundation level and then work up a structure so that even a complete novice like myself could learn PHP?

If I knew PHP like you then I'd have loads and loads of features on my site. Features that I'd never even think of tackling at the moment. For example, this fix here. If I knew PHP like you then I'd take it a step further and have this option shadowed out with a little (only available for orders over £100) in brackets like this:

Until their cart's at £100.00 of course and then it'd react as it's now doing:

21 Jan 2011, 2:06 PM
#22
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: minimum amount

Sorry, off hand I do not have a trick for that one ...

It would probably be easier to just customize the template for that page to give a message about it based on the amount of the order to show after the payment modules are displayed ...

21 Jan 2011, 2:27 PM
#23
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Re: minimum amount

I'm thinking of installing it as a new payment menthod and changing the name to 'shadow'. There are only three files in the entire mod (two of which are just language files) So, I'd just change all instances of "instalment" to "shadow" and install it again.

Then I'm thinking of using the code in #9 in reverse, so it appears on orders of under £100.00.

There should be a simple way of customising the language files to show a shadowed out .gif file instead of text.

The only difficulty I forsee is how to get rid of the radio button it would generate as it would effectively be a butchered payment module.

21 Jan 2011, 2:40 PM
#24
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: minimum amount

That is why I suggested to add some text below the display of the Payment modules on the template to only show when it should and then there is no radio button to deal with ...

21 Jan 2011, 2:54 PM
#25
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Re: minimum amount

"to only show when it should"

That's the key though. It's easy enough to add text to the checkout confirmation page, but how do you make that text only appear when the cart contents are <£100.00?

21 Jan 2011, 3:29 PM
#26
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: minimum amount

You add in the IF statement like we did in the module but you need to add it to the template using your templates and overrides ...

Look at the code in the tpl_checkout_payment_default.php and you can add:

<?php if ($order->info['total'] < 100.00) { ?>
<div class="alert"><?php echo 'WHERE AM I < 100.00 ' . $order->info['total']; ?></div>
<?php } else { ?>
<div class="alert"><?php echo 'WHERE AM I >= 100.00 ' . $order->info['total']; ?></div>
<?php } ?>
<br class="clearBoth" />

</fieldset>
<?php // ** BEGIN PAYPAL EXPRESS CHECKOUT **

the red code above the black code and fool with that ...

21 Jan 2011, 3:37 PM
#27
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Re: minimum amount

I'll give this a try when I get back in from the school run. However, if you see this response between now and then, could you let me know how I'd replace the output text "WHERE AM I" with an image, so that it displays an image instead of the text?

Would I replace WHERE AM I

with:

'<img src="https://www.silkblooms.co.uk/includes/images/shadow.gif" class="ShadowOut"> (only available on orders over £100.00)'

I'm not sure abut the apostrophes. That's always what messes me up! Little syntaxes.

21 Jan 2011, 4:23 PM
#28
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: minimum amount

You should be able to add in something like:
zen_image(DIR_WS_IMAGES . 'shadow.gif', '', '100%', '100%', 'class="ShadowOut"') . ' (only available on orders over £100.00)'

21 Jan 2011, 5:09 PM
#29
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Re: minimum amount

Getting something, here's the code I inserted in the tpl_checkout_split.php file, just about the PAYPAL fieldset:

<?php if ($order->info['total'] < 100.00) { ?>
<div class="alertInstalmentsShadowedOut"><?php echo zen_image(DIR_WS_TEMPLATE.'images/instalments_shadowed_out.gif'); ?></div>
<?php } ?>
<br class="clearBoth" />

Definitely working, I just need to style it in CSS now, so it appears in the correct position.

Thank you Ajeh!! I knoew you'd have the right tricks up your sleeve for this one. You underestimate yourself :)

21 Jan 2011, 5:37 PM
#30
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: minimum amount

Thanks for the update that you are starting to get things on track with this ... :smile:

19 Mar 2011, 11:39 PM
#31
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Re: minimum amount

Hi Ajeh,

If you're still following this thread then hopefully you'll have an idea to help me with a modification I'm working on that's lead me back here. If you look at this thread:

http://www.zen-cart.com/forum/showthread.php?p=1008763

You'll see that I've managed to integrate this 'pay by instlaments' feature into the main_page=account and the main_page=account_history_info&order_id=XXXX areas. I've managed to make it so a customer can enter the amount they'd like to pay towards their balance and check out with a monetary value in their cart. Very, very useful as it's going to save me endless manual invoicing.

I forsee one problem though. If you use the custom product I've set up for this:

http://www.silkblooms.co.uk/index.php?main_page=product_info&products_id=1652

If they add it to your cart and check out, then it might be confusing for the customer when they get to the checkout confirmation page and see that 'Pay by Instalments' is an actual option! Reminds me of a blonde joke in a round room and confusing her by asking her to stand in the corner, but people can be confused easily by checkout pages at the best of times. I don't particularly want my customers paying their instalments in instlaments :)

So, to cut a long story short, do you think there's a way to stop the 'Pay by Instalments' radio button from appearing on the main_page=checkout&action=null page? This custom INSTALMENTS product I've set up is always going to be "Product is Virtual: Yes, Skip Shipping Address" and "Products Quantity Box Shows: Yes, Show Quantity Box". So, perhaps there's a way to stop the 'Pay by Instalments' option appearing when this is the case as all my other products are not (they bring up the shiping options).

Sorry, hope this isn't too confusing? Reading it back and it's probably not very clear?

Maybe there's a way to stop the 'Pay by Instlaments' option when the weight of the product =0kg even?

20 Mar 2011, 12:28 AM
#32
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: minimum amount

What happens if this Product and others are in the order?

20 Mar 2011, 1:10 AM
#33
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Re: minimum amount

This product (INSTALMENTS) has a weight of zero.

All other products have a weight of >0

When both normal product and INSTALMENT product are in cart, it asks for shipping info at the checkout (as though it were a normal product with a weight >0)

20 Mar 2011, 3:37 AM
#34
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: minimum amount

When should the Pay by Installment show?

What happens when it should show and this Product and something that uses the Pay by Installment are in the same cart?

20 Mar 2011, 9:33 AM
#35
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Re: minimum amount

There would never be an instance when this product is added to the same cart as another product. Let me try to explain.

Our customers are able to add products to their cart as normal and check out. The products are physical goods, i.e., wedding bouquets and various types of artificial flowers. When they get to the checkout, they are presented with payment options as normal; PayPal, Nochex, Google Checkout, or 'Pay by Instalments'. This is exactly how it should be.

A lot of our customers have wedding dates well in advance as they like to plan their wedding. So, a big percentage of our sales are payment plans and the customer chooses the 'Pay by Instalments' payment method. Doing so will earn them a 20% deposit invoice. At this point they're booked into our calendar for shipping on a specific date that suits them.

In the time between purchase and shipping, they are able to pay for their order in amounts that suits them. A little at a time, or the remaining balance towards their date. It's up to them.

Up until now, I've been manually invoicing them when they wish to pay something towards their flowers. However, with a little help from 'Kobra', I've been able to implement a rather handy custom product:

http://www.silkblooms.co.uk/index.php?main_page=product_info&products_id=1652

If you look at it, you'll see that it lets the customer enter an amount in GBP and check out. When the 'order' comes through, we'll deduct it from their balance.

I've added a 'Pay an Instalment' button in their account pages too, so they can just click that and they're taken to the custom product above.

This product is completely hidden from other site users as it's in a hidden category. So, no one will add it to their cart. This product is there purely so customers can pay an instlament.

So, perferct. Until they get to the checkout page and find themselves presented with payment options again. When you're paying an instlament, you really shouldn't have another option to 'Pay by Instalments'. This shouldn't be an option.

The logic would be either:

if (cart weight = 0kg) then don't show 'pay by instalments'

OR

if (product in cart = product ID 1652) then don't show 'pay by instalments'

Would this be possible?

20 Mar 2011, 11:53 AM
#36
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Re: minimum amount

Another difference I can see that might help manipulate the logic is that there will never be a checkoutShippingMethods fieldset or even a checkoutShippingTable at the confirmation page when I want to disable the Pay by Instalments.

When you're paying an instalment, the product is virtual, so the shipping table is not on the page.

The INSTALMENT prodcut is the only product on the site where this will ever happen.

20 Mar 2011, 11:57 AM
#37
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Re: minimum amount

This is the logic that shadows out the Pay by Instlaments when the cart total is less than £100.00:

<?php if ($order->info['total'] < 100.00) { ?>
<div class="alertInstalmentsShadowedOut"><?php echo zen_image(DIR_WS_TEMPLATE.'images/instalments_shadowed_out.gif'); ?></div>
<?php } ?>
<br class="clearBoth" />

So, in summary, is there a statement I could add to this code that would also shadow it out if ($products_id == '1652') { for example?

20 Mar 2011, 12:09 PM
#38
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Re: minimum amount

I tried this one:

<?php if ($order->info['total'] < 100.00 or $order->info['weight'] == 0) { ?>

as the logic and it does use the shadowed out version, but it adds it in so there are two. One's shadowed out and the other is still there as normal:

20 Mar 2011, 1:27 PM
#39
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: minimum amount

You can control the $this->enabled for the payment module with:

if (!IS_ADMIN_FLAG) {
  global $cart;
  if ($_SESSION['cart']->show_weight() > 0) {
    $this->enabled = false;
  }
}

I do not know the code you are using but if this were the Check/Money Order moneyorder Payment module, the code would go below the code:

      $this->enabled = ((MODULE_PAYMENT_MONEYORDER_STATUS == 'True') ? true : false);
20 Mar 2011, 1:41 PM
#40
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Re: minimum amount

Perfect!! Thank you yet again Ajeh. You are a true genius!! A legend in fact!!!

It's coming together for me with this little mod, it's going to be really good. I just have a couple of little niggles I'm trying to iron out now. Not sure if it's your thing, but if you took a look at this thread then I bet your genius would shine through with an answer :)

http://www.zen-cart.com/forum/showthread.php?t=176751

I've gotten so far with it, but can't figure out the last part (an alternative checkout success page)