Community Forums

[vQmod] Regular and Discount Prices 1.5.x

Put any free vQmod scripts here.
vQmod details

[vQmod] Regular and Discount Prices 1.5.x

Postby fido-x » Sun Aug 28, 2011 2:09 am

Following from this thread: http://forum.opencart.com/viewtopic.php?f=22&t=22341, and at i2Paq's request, here's the vQmod to show the discounted amount and the percentage saved for special offer products and discounts.

discount_amount.xml
(3.65 KiB) Downloaded 1347 times
Image
If you're not living on the edge ... you're taking up too much space!
Multi-Vendor Plugin for OpenCart 1.5.1.x
Have I helped you?
User avatar
fido-x
 
Posts: 1960
Joined: Fri Jun 27, 2008 5:09 pm
Location: Tasmania, Australia

Re: [vQmod] Regular and Discount Prices 1.5.x

Postby i2Paq » Sun Aug 28, 2011 9:11 am

I think that a donation is well deserved: Done.
Norman in 't Veldt
Moderator OpenCart Forums

_________________ READ and Search BEFORE POSTING _________________
Our FREE search: Find your answer FAST!.

First Things First: Opencart Check List.
Documentation: Our Documentation section.
BUGs?: Known BUGS for All OC Versions.

Problemen met de BTW?: [How to] BTW + Verzend & betaalmethodes.
User avatar
i2Paq
Global Moderator
 
Posts: 9773
Joined: Mon Nov 09, 2009 11:00 am
Location: Winkel - The Netherlands

Re: [vQmod] Regular and Discount Prices 1.5.x

Postby fido-x » Sun Aug 28, 2011 4:13 pm

Thanks. Muchly appreciated.
Image
If you're not living on the edge ... you're taking up too much space!
Multi-Vendor Plugin for OpenCart 1.5.1.x
Have I helped you?
User avatar
fido-x
 
Posts: 1960
Joined: Fri Jun 27, 2008 5:09 pm
Location: Tasmania, Australia

Re: [vQmod] Regular and Discount Prices 1.5.x

Postby Jackcohen » Sun Aug 28, 2011 6:39 pm

May you show a screenshot of what this does exactly?
Jackcohen
 
Posts: 127
Joined: Sun Aug 07, 2011 5:08 am

Re: [vQmod] Regular and Discount Prices 1.5.x

Postby i2Paq » Sun Aug 28, 2011 7:07 pm

Jackcohen wrote:May you show a screenshot of what this does exactly?


Normal Price
Special Price
Money Saved
Discount Percentage
Attachments
ScreenHunter_01 Aug. 28 21.05.gif
ScreenHunter_01 Aug. 28 21.05.gif (2.35 KiB) Viewed 5936 times
Norman in 't Veldt
Moderator OpenCart Forums

_________________ READ and Search BEFORE POSTING _________________
Our FREE search: Find your answer FAST!.

First Things First: Opencart Check List.
Documentation: Our Documentation section.
BUGs?: Known BUGS for All OC Versions.

Problemen met de BTW?: [How to] BTW + Verzend & betaalmethodes.
User avatar
i2Paq
Global Moderator
 
Posts: 9773
Joined: Mon Nov 09, 2009 11:00 am
Location: Winkel - The Netherlands

Re: [vQmod] Regular and Discount Prices 1.5.x

Postby mkh » Sun Aug 28, 2011 8:24 pm

Thanks alot for this... Really a great module...
mkh
 
Posts: 29
Joined: Thu Jun 23, 2011 5:55 pm

Re: [vQmod] Regular and Discount Prices 1.5.x

Postby Maansy » Sun Aug 28, 2011 9:52 pm

Thanks fido-x
Will try it when I get back.
ALL Templates :: 1.5.1+ Templates :: 50%-75% PRICE DROP ONLY at OpencartStuff.com
User avatar
Maansy
 
Posts: 930
Joined: Wed Jun 23, 2010 10:04 pm

Re: [vQmod] Regular and Discount Prices 1.5.x

Postby Flap » Thu Sep 08, 2011 1:53 pm

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>
Flap
 
Posts: 9
Joined: Thu Sep 08, 2011 1:51 pm

Re: [vQmod] Regular and Discount Prices 1.5.x

Postby Eva30 » Sat Sep 17, 2011 4:09 pm

Very nice one,just must have!
thank you.
User avatar
Eva30
 
Posts: 30
Joined: Fri Sep 09, 2011 8:17 am

Re: [vQmod] Regular and Discount Prices 1.5.x

Postby smitch6 » Mon Sep 19, 2011 8:33 am

Hi i presume you put this in the vqmod/xml folder?

once it's install how do you do the discount thing?

thanks
smitch6
 
Posts: 155
Joined: Sat Sep 17, 2011 6:46 am

Re: [vQmod] Regular and Discount Prices 1.5.x

Postby smitch6 » Tue Sep 20, 2011 2:16 pm

can anyone help with this please ???
smitch6
 
Posts: 155
Joined: Sat Sep 17, 2011 6:46 am

Re: [vQmod] Regular and Discount Prices 1.5.x

Postby terrier » Tue Sep 20, 2011 6:20 pm

Go under product -> click on Special tab -> add your special price amount -> save

Go to your site and click on the product.. you should see a regular and discounted value -> with the discounted %
terrier
 
Posts: 27
Joined: Wed Aug 31, 2011 11:05 am

Re: [vQmod] Regular and Discount Prices 1.5.x

Postby smitch6 » Tue Sep 20, 2011 6:38 pm

brill thanks :D
smitch6
 
Posts: 155
Joined: Sat Sep 17, 2011 6:46 am

Re: [vQmod] Regular and Discount Prices 1.5.x

Postby Eva30 » Wed Sep 21, 2011 11:16 pm

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>

how to make it multi lang?
(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.
User avatar
Eva30
 
Posts: 30
Joined: Fri Sep 09, 2011 8:17 am

Re: [vQmod] Regular and Discount Prices 1.5.x

Postby prodac » Tue Oct 25, 2011 11:43 pm

Yeah, I was also wondering about using this for other languages that English... ANyone got a solution for that?
prodac
 
Posts: 9
Joined: Tue Oct 25, 2011 11:37 pm

Re: [vQmod] Regular and Discount Prices 1.5.x

Postby marvmen21 » Wed Oct 26, 2011 1:22 am

I am not an expert, but it should be as easy as copying and pasting the language parts and changing the path to your custom language. If it is not working that way, then you need to check your language file, the code in the search tag might be different or not present in your language file; Therefore, vqmod is not finding the line and obviously not adding the code. Try changing...
Code: Select all
<search position="before" index="1"><![CDATA[
         // Entry
         ]]></search>


TO...
Code: Select all
<search position="after"><![CDATA[
         <?php
         ]]></search>

This way it works with any language file, and will add the code just after the opening tag.
You want to thank me for my time! :) Click here to donate
marvmen21
 
Posts: 364
Joined: Mon Nov 08, 2010 8:54 pm

Re: [vQmod] Regular and Discount Prices 1.5.x

Postby prodac » Wed Oct 26, 2011 1:54 am

I fixed the language problem by replacing the language name and the theme name in the xml file :)
prodac
 
Posts: 9
Joined: Tue Oct 25, 2011 11:37 pm

Re: [vQmod] Regular and Discount Prices 1.5.x

Postby vickiowa » Thu Oct 27, 2011 7:09 pm

Hi...

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.
vickiowa
 
Posts: 18
Joined: Mon Sep 26, 2011 10:16 pm

Re: [vQmod] Regular and Discount Prices 1.5.x

Postby wired-circuit » Fri Oct 28, 2011 5:57 pm

I have the same issue as vickiowa
wired-circuit
 
Posts: 27
Joined: Thu Mar 24, 2011 6:48 am

Re: [vQmod] Regular and Discount Prices 1.5.x

Postby snoopster » Sun Nov 27, 2011 11:09 pm

Can this mod be adjusted for 'Featured module' ? Because I tried it just for the percentage saving and it shows the same percentage for all the products in the featured area.

A little help would be appreciated.

Thank you very much.
snoopster
 
Posts: 12
Joined: Sun Nov 27, 2011 11:06 pm

Next

Return to vQmods

Who is online

Users browsing this forum: f1br3opt1c and 7 guests

Hosted by Arvixe Web Hosting