Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool
If you're not living on the edge ... you're taking up too much space!
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.
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool
If you're not living on the edge ... you're taking up too much space!
Normal PriceJackcohen wrote:May you show a screenshot of what this does exactly?
Special Price
Money Saved
Discount Percentage
Attachments
ScreenHunter_01 Aug. 28 21.05.gif (2.35 KiB) Viewed 20540 times
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.
Will try it when I get back.
ALL Templates :: 1.5.1+ Templates :: 50%-75% PRICE DROP ONLY at OpencartStuff.com
I made this:
Code: Select all
<modification>
<id>Product Discount</id>
<version>1.0.0</version>
<vqmver>1.2.3</vqmver>
<author>Fido-X</author>
<file name="catalog/controller/product/product.php">
<operation>
<search position="after"><![CDATA[
$this->data['text_tags'] = $this->language->get('text_tags');
]]></search>
<add><![CDATA[
// Added for discounts
$this->data['text_discounted'] = $this->language->get('text_discounted');
$this->data['text_percent_saved'] = $this->language->get('text_percent_saved');
// End discounts addition
]]></add>
</operation>
<operation>
<search position="after"><![CDATA[
$this->data['special'] = $this->currency->format($this->tax->calculate($product_info['special'], $product_info['tax_class_id'], $this->config->get('config_tax')));
]]></search>
<add><![CDATA[
// Added for discounts
$this->data['discount_amount'] = $this->currency->format($this->tax->calculate(($product_info['price'] - $product_info['special']), $product_info['tax_class_id'], $this->config->get('config_tax')));
$this->data['percent_savings'] = round((($product_info['price'] - $product_info['special']) / $product_info['price'] * 100));
// End discounts addition
]]></add>
</operation>
<operation>
<search position="after"><![CDATA[
foreach ($discounts as $discount) {
]]></search>
<add><![CDATA[
// Added for discounts
$discount_amount = $this->currency->format($this->tax->calculate(($product_info['price'] - $discount['price']), $product_info['tax_class_id'], $this->config->get('config_tax')));
$discount_amount = $this->currency->format($product_info['price'] - $discount['price']);
$percent_savings = round((($product_info['price'] - $discount['price']) / $product_info['price'] * 100));
// End discounts addition
]]></add>
</operation>
<operation>
<search position="after"><![CDATA[
'quantity' => $discount['quantity'],
]]></search>
<add><![CDATA[
// Added for discounts
'discount_amount' => $discount_amount,
'percent_savings' => $percent_savings,
// End discounts addition
]]></add>
</operation>
</file>
<file name="catalog/language/english/product/product.php">
<operation>
<search position="before" index="1"><![CDATA[
// Entry
]]></search>
<add><![CDATA[
// Added for discounts
$_['text_discounted'] = 'Discount:';
$_['text_percent_saved'] = 'Save:';
]]></add>
</operation>
</file>
[color=#FF0000]<file name="catalog/language/czech/product/product.php">
<operation>
<search position="before" index="1"><![CDATA[
// Entry
]]></search>
<add><![CDATA[
// Added for discounts
$_['text_discounted'] = 'Ušetříte:';
$_['text_percent_saved'] = 'Sleva:';
]]></add>
</operation>
</file> [/color]
<file name="catalog/view/theme/default/template/product/product.tpl">
<operation>
<search position="after" index="1"><![CDATA[
<span class="price-old"><?php echo $price; ?></span> <span class="price-new"><?php echo $special; ?></span>
]]></search>
<add><![CDATA[
<!-- Discounted price -->
<table>
<tr>
<td style="width: 80px;"><?php echo $text_discounted; ?></td>
<td><?php echo $discount_amount; ?></td>
</tr>
<tr>
<td><?php echo $text_percent_saved; ?></td>
<td><?php echo $percent_savings; ?>%</td>
</tr>
</table>
<!-- End discounted price -->
]]></add>
</operation>
<operation>
<search position="after" index="1"><![CDATA[
<?php echo sprintf($text_discount, $discount['quantity'], $discount['price']); ?><br />
]]></search>
<add><![CDATA[
<!-- Discounted price -->
<table>
<tr>
<td style="width: 80px;"><?php echo $text_discounted; ?></td>
<td><?php echo $discount['discount_amount']; ?></td>
</tr>
<tr>
<td><?php echo $text_percent_saved; ?></td>
<td><?php echo $discount['percent_savings']; ?>%</td>
</tr>
</table>
<!-- End discounted price -->
]]></add>
</operation>
</file>
</modification>
Code: Select all
<file name="catalog/language/czech/product/product.php">
<operation>
<search position="before" index="1"><![CDATA[
// Entry
]]></search>
<add><![CDATA[
// Added for discounts
$_['text_discounted'] = 'Ušetříte:';
$_['text_percent_saved'] = 'Sleva:';
]]></add>
</operation>
</file>
once it's install how do you do the discount thing?
thanks
how to make it multi lang?Flap wrote:Can anyone help me to add this to more languages? It works for english but when I copy code from english and use it for another languaget it simply disappear.
I made this:Code: Select all
<modification> <id>Product Discount</id> <version>1.0.0</version> <vqmver>1.2.3</vqmver> <author>Fido-X</author> <file name="catalog/controller/product/product.php"> <operation> <search position="after"><![CDATA[ $this->data['text_tags'] = $this->language->get('text_tags'); ]]></search> <add><![CDATA[ // Added for discounts $this->data['text_discounted'] = $this->language->get('text_discounted'); $this->data['text_percent_saved'] = $this->language->get('text_percent_saved'); // End discounts addition ]]></add> </operation> <operation> <search position="after"><![CDATA[ $this->data['special'] = $this->currency->format($this->tax->calculate($product_info['special'], $product_info['tax_class_id'], $this->config->get('config_tax'))); ]]></search> <add><![CDATA[ // Added for discounts $this->data['discount_amount'] = $this->currency->format($this->tax->calculate(($product_info['price'] - $product_info['special']), $product_info['tax_class_id'], $this->config->get('config_tax'))); $this->data['percent_savings'] = round((($product_info['price'] - $product_info['special']) / $product_info['price'] * 100)); // End discounts addition ]]></add> </operation> <operation> <search position="after"><![CDATA[ foreach ($discounts as $discount) { ]]></search> <add><![CDATA[ // Added for discounts $discount_amount = $this->currency->format($this->tax->calculate(($product_info['price'] - $discount['price']), $product_info['tax_class_id'], $this->config->get('config_tax'))); $discount_amount = $this->currency->format($product_info['price'] - $discount['price']); $percent_savings = round((($product_info['price'] - $discount['price']) / $product_info['price'] * 100)); // End discounts addition ]]></add> </operation> <operation> <search position="after"><![CDATA[ 'quantity' => $discount['quantity'], ]]></search> <add><![CDATA[ // Added for discounts 'discount_amount' => $discount_amount, 'percent_savings' => $percent_savings, // End discounts addition ]]></add> </operation> </file> <file name="catalog/language/english/product/product.php"> <operation> <search position="before" index="1"><![CDATA[ // Entry ]]></search> <add><![CDATA[ // Added for discounts $_['text_discounted'] = 'Discount:'; $_['text_percent_saved'] = 'Save:'; ]]></add> </operation> </file> [color=#FF0000]<file name="catalog/language/czech/product/product.php"> <operation> <search position="before" index="1"><![CDATA[ // Entry ]]></search> <add><![CDATA[ // Added for discounts $_['text_discounted'] = 'Ušetříte:'; $_['text_percent_saved'] = 'Sleva:'; ]]></add> </operation> </file> [/color] <file name="catalog/view/theme/default/template/product/product.tpl"> <operation> <search position="after" index="1"><![CDATA[ <span class="price-old"><?php echo $price; ?></span> <span class="price-new"><?php echo $special; ?></span> ]]></search> <add><![CDATA[ <!-- Discounted price --> <table> <tr> <td style="width: 80px;"><?php echo $text_discounted; ?></td> <td><?php echo $discount_amount; ?></td> </tr> <tr> <td><?php echo $text_percent_saved; ?></td> <td><?php echo $percent_savings; ?>%</td> </tr> </table> <!-- End discounted price --> ]]></add> </operation> <operation> <search position="after" index="1"><![CDATA[ <?php echo sprintf($text_discount, $discount['quantity'], $discount['price']); ?><br /> ]]></search> <add><![CDATA[ <!-- Discounted price --> <table> <tr> <td style="width: 80px;"><?php echo $text_discounted; ?></td> <td><?php echo $discount['discount_amount']; ?></td> </tr> <tr> <td><?php echo $text_percent_saved; ?></td> <td><?php echo $discount['percent_savings']; ?>%</td> </tr> </table> <!-- End discounted price --> ]]></add> </operation> </file> </modification>
Code: Select all
<file name="catalog/language/czech/product/product.php"> <operation> <search position="before" index="1"><![CDATA[ // Entry ]]></search> <add><![CDATA[ // Added for discounts $_['text_discounted'] = 'Ušetříte:'; $_['text_percent_saved'] = 'Sleva:'; ]]></add> </operation> </file>
(FR, NL, EN, DE, IT)
or maybe there is some way to make all vQmods multi lang?
most of the time some thinks are missing with translations (text_here, something_here) if you know what i mean.
Code: Select all
<search position="before" index="1"><![CDATA[
// Entry
]]></search>
Code: Select all
<search position="after"><![CDATA[
<?php
]]></search>
You want to thank me for my time! Click here to donate
excellent mod... I'm using OC 1.5.1.1 and Shoppica.net 1.0.9 (August release) theme.
Uploaded the XML file to the vqmod\xml folder but the discount absolute amount and discount % is not shown on the product page.
Does anyone who has successfully installed the module with Shoppica help?
Thanks, Vick
PS Would also like to know the PP to make a small donation.
A little help would be appreciated.
Thank you very much.
Users browsing this forum: No registered users and 43 guests