Hi Ajeh, I thought I had this working, but it's actually causing a problem that I hadn't noticed until now. Let me try and explain using some logic bullet points so you can understand what's happening :)
- all products on www.silkblooms.co.uk have a product weight assigned that's > 0 (apart from product 1652)
- product ID 1652 has been customised as an incremental value product so that people can enter a value into their cart and checkout (thereby paying an instalment towards tehir account balance) it's weight set to 0 so I can manipulate behaviour below
- I'm using a modified vesrsion of the accountholder mod as a way of letting people check out on a payment plan if their cart value is > 100.00 (works perfectly). If their cart is < 100.00 it does not appear if (!IS_ADMIN_FLAG && $order->info['subtotal'] < 100.00 {$this->enabled = false;} (works perfectly)
- I'm trying to prevent the accountholder mod from appearing as an option when people only have product ID 1652 in their cart (when they're paying an instalament towards their outstanding balance, I don't want them being able to select 'Pay by Instalments' as an option). This is what's causing the problems. I thought I had this working but I hadn't noticed the problem our coding has caused, until now.
Here is a copy of the PHP used to modify the accountholder.php file:
As I say, I thought this was working and to a certain extent it is. When a product is added to the cart and it's weight is 0kg then the acountholder.php (pay by instalments) is not showing as an option at the checkout confirmation page. Great, but it's doing something to all other procuts too!!PHP Code:// class constructor
function accountholder() {
global $order;
$this->code = 'accountholder';
$this->title = MODULE_PAYMENT_ACCOUNTHOLDER_TEXT_TITLE;
if (IS_ADMIN_FLAG === true && (MODULE_PAYMENT_ACCOUNTHOLDER_PAYTO == 'Just pay the rest when you can' || MODULE_PAYMENT_ACCOUNTHOLDER_PAYTO == '')) $this->title .= '<span class="alert"> </span>';
$this->description = MODULE_PAYMENT_ACCOUNTHOLDER_TEXT_DESCRIPTION;
$this->sort_order = MODULE_PAYMENT_ACCOUNTHOLDER_SORT_ORDER;
$this->enabled = ((MODULE_PAYMENT_ACCOUNTHOLDER_STATUS == 'True') ? true : false);
if (!IS_ADMIN_FLAG) {
global $cart;
if ($_SESSION['cart']->show_weight() == 0) {
$this->enabled = false;
}
}
// bof: disable based on Order Amount
// use $order->info['subtotal'] or $order->info['subtotal']
if (!IS_ADMIN_FLAG && $order->info['subtotal'] < 100.00) {
$this->enabled = false;
}
// eof: disable based on Order Amount
When I add a normal product to my cart with weight >0 it's somehoe causing the cart summart to display as 0kg (even though product weight is definitely > 0). Then when I add product ID 1652 to the cart it starts to calculate the other produc'ts weight correctly.
I hope you can understand my problem. I've tried to be as concise as possible in the hope that you can see what's wrong and shed some of your wisdom on this for me once more?


Reply With Quote


