Have a good look at: Hide add to cart button for items not in stock?, here you find everything you need.
Norman in 't Veldt
Moderator OpenCart Forums
_________________ READ and Search BEFORE POSTING _________________
Our FREE search: Find your answer FAST!.
[How to] BTW + Verzend + betaal setup.
Thanks i2Paq, I'll check it out!
The problem with this forum is, that there's loads of information available, but it gets hard finding the
right URL's...
Gr33tz
The problem with this forum is, that there's loads of information available, but it gets hard finding the
right URL's...
Gr33tz
Dimitri Backaert
Web Development, Application Development, OOP, .NET, IBM Cognos BI
Doesn't work on the Pick-up from StoreQphoria wrote:Try this:nzjollyroger wrote: however when you have pickup for shipping its show ups as:
is there some way to make it apply to everything but the free shipping ?
Code: Select all
if ($format && (int)$value == 0) { $trace = debug_backtrace(); if (isset($trace[1]) && $trace[1]['class'] == 'ModelShippingFree') { return "0.00"; } else { return 'coming soon'; } }
Hi Q,
is there a way to make the text substitution in this MOD only show once in Product Description page & Category pages if used in combination with 'Prices shown with & without VAT' - currently I get 'Call for Price' twice.. I'm using the code suggested in these two threads:
http://forum.opencart.com/viewtopic.php ... 25&start=0
http://forum.opencart.com/viewtopic.php ... 54#p112554
Thanks.
is there a way to make the text substitution in this MOD only show once in Product Description page & Category pages if used in combination with 'Prices shown with & without VAT' - currently I get 'Call for Price' twice.. I'm using the code suggested in these two threads:
http://forum.opencart.com/viewtopic.php ... 25&start=0
http://forum.opencart.com/viewtopic.php ... 54#p112554
Thanks.
Hi! I just upgraded to 4.9.1. I have Q's Option Price Update and Options Plus Mods installed - we sell things using weight-based options. I am trying to get this to work so that instead of a $0.00 price, it says "Please select weight option"
However, as the page loads, I can see the text "Please select weight option" flash - but then it disappears and is replaced with $NaN as the price. Selecting a weight option does not update the price (it remains $NaN). I appreciate any help - this is my first Opencart installation and so far it has been great!
Edit: Just to be clear - I am trying to make this work using the single edit to currency.php.
However, as the page loads, I can see the text "Please select weight option" flash - but then it disappears and is replaced with $NaN as the price. Selecting a weight option does not update the price (it remains $NaN). I appreciate any help - this is my first Opencart installation and so far it has been great!
Edit: Just to be clear - I am trying to make this work using the single edit to currency.php.
..just wondered if anyone came up with a solution to this particular question +same problem appears in Product Options?Marcel wrote:Thanks this works nicely
My sold products are now in a Category called Sold and they show SOLD instead of a price.
My Free Shipping shows as 0.00 in Delivery Information
But here's the problem, in the final step of the checkout under Totals
the Free Shipping item shows as SOLD
Thanks.
I've been going over the php files for the 'checkout' & 'product options' controllers & suspect there's a way to use a line similar to
in system/currency.php to specify those classes as well but can't for the life of me work out how to declare them!
Can anyone please enlighten me ..it's getting late here!
Code: Select all
if (isset($trace[1]) && $trace[1]['class'] == 'ModelShippingFree') {
Can anyone please enlighten me ..it's getting late here!
Feels like I'm writing to myself on here these days
I thought I needed to declare the 'ControllerCheckoutConfirm' class as well to solve the checkout problem but has had no effect when written like this:
Anyone have any suggestions?
I thought I needed to declare the 'ControllerCheckoutConfirm' class as well to solve the checkout problem but has had no effect when written like this:
Code: Select all
if ($format && (int)$value == 0) {
$trace = debug_backtrace();
if (isset($trace[1]) && $trace[1]['class'] == 'ModelShippingFree') {
return "£0.00";
} elseif (isset($trace[1]) && $trace[1]['class'] == 'ControllerCheckoutShipping') {
return "£0.00";
} else {
return 'Call for Price';
}
}
Am going to continue talking to myself as the solutions I'm discovering may be of use to other php newbies like me..
Well, I have managed to solve the Checkout problem [only by lots of trial & error]:
This works great but am still left with the problem of trying to display £0.00 within the Product Options drop-down list.. Feel free to chip in if anyone knows
Got a hunch it should be 'ModelCatalogProduct' but how to separate this from Product's price & also am not sure you can have more than one instance of elseif ??
Well, I have managed to solve the Checkout problem [only by lots of trial & error]:
Code: Select all
if ($format && (int)$value == 0) {
$trace = debug_backtrace();
if (isset($trace[1]) && $trace[1]['class'] == 'ModelShippingFree') {
return "£0.00";
} elseif (isset($trace[1]) && $trace[1]['class'] == 'ModelTotalShipping') {
return "£0.00";
} else {
return 'Call for Price';
}
}
Got a hunch it should be 'ModelCatalogProduct' but how to separate this from Product's price & also am not sure you can have more than one instance of elseif ??
Okay, here's an interesting anomaly; I've just realized that within the product Options drop-down list, the items which are declared as +0.00 actually have nothing showing as an additional value, yet any item which has an additional value between 0 & 1, ie: +0.85 are the ones now showing as 'Call for Price'.
I've tried changing the initial line to:
&
but with no joy.
Any ideas, feel free to pitch in..
I've tried changing the initial line to:
Code: Select all
if ($format && (int)$value == 0.0000) {
&
Code: Select all
if ($format && (int)$value == 0.00) {
Any ideas, feel free to pitch in..
Problem solved! All it needed was anextra '=' in the first line:
**Added after I posted**
Not quite! Now the product's price is showing as £0.00 again - doh!
Code: Select all
if ($format && (int)$value === 0.00) {
$trace = debug_backtrace();
if (isset($trace[1]) && $trace[1]['class'] == 'ModelShippingFree') {
return "£0.00";
} elseif (isset($trace[1]) && $trace[1]['class'] == 'ModelTotalShipping') {
return "£0.00";
} else {
return 'Call for Price';
}
}
Not quite! Now the product's price is showing as £0.00 again - doh!
Im really getting FED UP with this !! Now I get 'Call for Price' as it should be in Category view but then 0 in Product view
There has to be a way to distinguish between Option value and Product price..
Is there anyone still alive on this forum?
Code: Select all
if ($format && (int)$value == 0.00) {
$trace = debug_backtrace();
if (isset($trace[1]) && $trace[1]['class'] === 'ModelShippingFree') {
return "£0.00";
} elseif (isset($trace[1]) && $trace[1]['class'] === 'ModelTotalShipping') {
return "£0.00";
} elseif (isset($trace[1]) && $trace[1]['class'] === 'ControllerProductProduct') {
return "$value";
} else {
return 'Call for Price';
}
}
Is there anyone still alive on this forum?
Qphoria you are a freakin genius!!!.......thanks so much.....works perfectly in 1.4.9.3
Qphoria wrote:A little trick to make this a lot easier for you..
Remember all prices pass through the currency->format() function, even if they are 0
1. EDIT: system/library/currency.php (or system/helper/currency.php for certain versions)
2. FIND:3. BEFORE, ADD:Code: Select all
$string = '';
That's it! One file handles ALL places.. even custom mods are automatically changedCode: Select all
if ($format && (float)$value == 0) { return 'FREE'; }
Just to clarify for anyone going through this post that you MUST use
if ($format && (float)$value == 0) {
rather than with an INT
If you use an INT anything at £0.99 or below will show as FREE
if ($format && (float)$value == 0) {
rather than with an INT
If you use an INT anything at £0.99 or below will show as FREE
Cubecart to Opencart Migrations
KashFlow Accounting Integration with OpenCart
Hi... elseif (isset($trace[1]) && $trace[1]['class'] === 'ControllerProductProduct') {deeve wrote:Im really getting FED UP with this !! Now I get 'Call for Price' as it should be in Category view but then 0 in Product viewThere has to be a way to distinguish between Option value and Product price..Code: Select all
if ($format && (int)$value == 0.00) { $trace = debug_backtrace(); if (isset($trace[1]) && $trace[1]['class'] === 'ModelShippingFree') { return "£0.00"; } elseif (isset($trace[1]) && $trace[1]['class'] === 'ModelTotalShipping') { return "£0.00"; } elseif (isset($trace[1]) && $trace[1]['class'] === 'ControllerProductProduct') { return "$value"; } else { return 'Call for Price'; } }
Is there anyone still alive on this forum?
return "$value";
} this code is reduntant because it's said in the code above that if an amount is equal to 0 it displays call for price so all you need to do is to set product's price to 0 and it displays call for price on zero priced products.and another thing your code says to put a price in zero priced products.
to more expirienced programmers:
the code above works fine except it is now showing call for price instead of 0,00 amount in my cart in header.
i tried adding elseif ($trace[1] && $trace[1]['class'] === 'ControllerCheckoutCart') {
return "$value.00$symbol_right";
}
but it doesn't do the trick. what needs to be done to sort this out.Thanks in advance.
Who is online
Users browsing this forum: No registered users and 1 guest