Simple question.....is ist possible to call different words to the cart text based on quantity.
I our cuntry we also have special word for 2 products.
1 product...product
2 products.... in SLOVENIA diferent word
3 and more products...products
Is there a simple code that would pull the corect word based on quantity that is in cart from language file.
Thanx in advance Andrej
Hello Jerdna,
You need to add custom JS through which you can add different text in cart according to quantity, as this is a modification in core file so you need to use vQmod or Ocmod file (according to your OC Version) to add a JS into core file.
Thanks.
You need to add custom JS through which you can add different text in cart according to quantity, as this is a modification in core file so you need to use vQmod or Ocmod file (according to your OC Version) to add a JS into core file.
Thanks.
Call us at : (+91) -8765210318 , Skype: live:carlmorgan.cedcommerce , Email: support@cedcommerce.com
CedCommerece : Officail Opencart Partners
CedCommerce Official : www.cedcommerce.com
Opencart Services : www.cedcommerce/opencart-services.com
Sell On various Marketplace Integration : Opencart-Extensions
Magenative Mobile App/IOS Development : magenative.com
Webinar : Power up Your holiday season marketing with the Automation tool
For those who need a custom solution (no perfect but works for me)
//in language files define plural like below
//in system/general.php add
//usage
//in language files define plural like below
Code: Select all
$_['text_reviews'] = '%s reviews|%s review';
Code: Select all
if(!function_exists('returnPlural')){
function returnPlural($message, $count, $delimiter="|"){
return strpos($message, $delimiter) !== false ?
str_replace($delimiter, '', substr(stristr(sprintf($message, $count, $count), $delimiter, ($count <= 1 ? 0 : 1)), 0)) :
sprintf($message, $count);
}
}
Code: Select all
$reviews = returnPlural($this->language->get('text_reviews'), (int)$result['reviews']);
Who is online
Users browsing this forum: No registered users and 97 guests