Show final price in Category Layout

Professional eCommerce VirtueMart Joomla template with responsive design discussion forum.
Rate this topic: Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.1.00 out of 6 based on 1 vote(s)
GK User
Mon Mar 10, 2014 11:52 pm
Reply with quote
Report this post
Hi, I checked in Category view Layout undiscounted price shown. I would like to design category could see final price.

In store price is very important. If the buyer thinks the price is high, it may not be very interested to see the article.

How I can do to show on category view the final price and the full price?

I have found that if I disable the InStyle template and leave the default Virtuemart template, if the two prices shown.

Here you can see an example. The "Jersey Fornarina" shows a price of 79.70 in the category view and if you see the article that the final price is 55.79.

http://ottro.com/rebajas

http://ottro.com/rebajas/jersey-fornarina-kettler-angora-negra-detail

Thank you for your great work and your attention to the forum.
Javier
User avatar
Junior Boarder

teitbite
Tue Mar 11, 2014 9:23 pm
Reply with quote
Report this post
Hi

Please edit file: /html/com_virtuemart/category/default.php and find code:

Code: Select all
                  if ($this->show_prices == '1') {
                     if ($product->prices['salesPrice']<=0 and VmConfig::get ('askprice', 1) and  !$product->images[0]->file_is_downloadable) {
                        echo JText::_ ('COM_VIRTUEMART_PRODUCT_ASKPRICE');
                     }                  
                     echo $this->currency->createPriceDiv('basePriceWithTax', '', $product->prices);
                     echo $this->currency->createPriceDiv('taxAmount','TPL_GK_LANG_VM_INC_TAX', $product->prices);
                  } ?>


replace 'basePriceWithTax' with 'salesPrice'. Should display the final price instead.
User avatar
Moderator

GK User
Tue Mar 11, 2014 11:09 pm
Reply with quote
Report this post
Hello, first of all, thanks for your suggestion. I followed your instructions and it works. Now Category Overview the final sale price shown.

But I have two problems.

1 has been lost estido template in the final price.

2nd the final price is shown only. For me it is very important that the retail price before discount and the discounted price is displayed. So the buyer can see what you save buying the item.

I think it would be very important that this option does appear in the original Virtuemart template is available. For buyers it is very important to compare the original price and the discounted price.

I performed the test in a subdirectory that I have cloned the site:

http://clon.ottro.com/rebajas

http://clon.ottro.com/rebajas/camiseta-lipsy-cristales-swarovski-negra-detail

I hope your suggestions.
thanks
User avatar
Junior Boarder

teitbite
Thu Mar 13, 2014 10:54 am
Reply with quote
Report this post
Hi

This time it's much more complicated to answer without a work with code. Plese send me an access to ftp. I'll make this changes and will write all steps here after.
User avatar
Moderator

GK User
Thu Mar 13, 2014 11:47 am
Reply with quote
Report this post
Thank you very much, you have FTP access data.
User avatar
Junior Boarder

teitbite
Thu Mar 13, 2014 9:01 pm
Reply with quote
Report this post
Hi

Sorry, for bothering, but looks like I have found my own answer to same question today, so FTP was not neccessary. Please take a look at this post:

https://www.gavick.com/forums/instyle/s ... discounted price#p164558
User avatar
Moderator

GK User
Thu Mar 13, 2014 10:37 pm
Reply with quote
Report this post
Hello, I followed your instructions (https://www.gavick.com/forums/instyle/showing-price-in-category-layout-32570.html?p=159978&hilit=discounted) and I think that we are near the solution. The orignal price is crossed out. It is fine. But it shows the price with the discount. Instead displays a number. RM + Number. I do not know what it means. It is very strange.

http://clon.ottro.com/rebajas

I send two screenshots.

Thanks again, I have hopes of finding a solution.
Javier
User avatar
Junior Boarder

teitbite
Fri Mar 14, 2014 10:19 pm
Reply with quote
Report this post
Hi

That's becuase it's a currency symbol for this user I helped. In Your case use this code:

Code: Select all
               <?php
                  if ($this->show_prices == '1') {
                     if( $product->prices['discountedPriceWithoutTax'] ):
                        echo '<span style="text-decoration: line-through;">' . $this->currency->createPriceDiv('basePriceWithTax', '', $product->prices) . '</span>'
                        . number_format( (float)$product->prices['discountedPriceWithoutTax'], 2. ',', '' ) . ' €';
                     else:
                        if ($product->prices['salesPrice']<=0 and VmConfig::get ('askprice', 1) and  !$product->images[0]->file_is_downloadable) {
                           echo JText::_ ('COM_VIRTUEMART_PRODUCT_ASKPRICE');
                        }
                        echo $this->currency->createPriceDiv('basePriceWithTax', '', $product->prices);
                        echo $this->currency->createPriceDiv('taxAmount','TPL_GK_LANG_VM_INC_TAX', $product->prices);
                     endif;
                  } ?>
User avatar
Moderator

GK User
Mon Mar 17, 2014 6:45 pm
Reply with quote
Report this post
Hi, I used the code you provided me. Now I see a blank screen in the category view. Here you can see the code and where I put it.

Code: Select all
<div class="catProductPrice" id="productPrice<?php echo $product->virtuemart_product_id ?>">
                              <?php
                  if ($this->show_prices == '1') {
                     if( $product->prices['discountedPriceWithoutTax'] ):
                        echo '<span style="text-decoration: line-through;">' . $this->currency->createPriceDiv('basePriceWithTax', '', $product->prices) . '</span>'
                        . number_format( (float)$product->prices['discountedPriceWithoutTax'], 2. ',', '' ) . ' €';
                     else:
                        if ($product->prices['salesPrice']<=0 and VmConfig::get ('askprice', 1) and  !$product->images[0]->file_is_downloadable) {
                           echo JText::_ ('COM_VIRTUEMART_PRODUCT_ASKPRICE');
                        }
                        echo $this->currency->createPriceDiv('basePriceWithTax', '', $product->prices);
                        echo $this->currency->createPriceDiv('taxAmount','TPL_GK_LANG_VM_INC_TAX', $product->prices);
                     endif;
                  } ?>
               </div>


There must be some problem with the code you've shown me in your last response.

http://clon.ottro.com/rebajas

http://clon.ottro.com

Hope news.
Thank you.
User avatar
Junior Boarder

teitbite
Mon Mar 17, 2014 10:25 pm
Reply with quote
Report this post
Hi

Yes, this has to be a syntax error. Please enable showing errors to maximum in joomla global configuration and send me an access to ftp.
User avatar
Moderator

GK User
Mon Mar 17, 2014 11:29 pm
Reply with quote
Report this post
You already have access data by FTP. This is the error:

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /mnt/web7/d1/12/53520612/htdocs/clon/templates/gk_instyle/html/com_virtuemart/category/default.php on line 197

Thanks for your help!
User avatar
Junior Boarder

teitbite
Tue Mar 18, 2014 8:34 pm
Reply with quote
Report this post
Hi

I have not used it last time, becuase I had same question and used this user site to help with both websites. Anyway I have just looked for Your message with ftp details and I cannot find a password. Host and user are there, just no password anywhere. Please send it to me.
User avatar
Moderator

GK User
Wed Mar 19, 2014 10:10 am
Reply with quote
Report this post
Hello, sorry. I have sent the password.

thanks
User avatar
Junior Boarder

teitbite
Wed Mar 19, 2014 11:18 am
Reply with quote
Report this post
Hi

Fixed. There was a dot instead of comma. Small mistake, but could not work.
User avatar
Moderator

GK User
Tue Mar 25, 2014 2:02 pm
Reply with quote
Report this post
Thank you very much. I put the corrected code here:

Code: Select all
<div class="catProductPrice" id="productPrice<?php echo $product->virtuemart_product_id ?>">
                              <?php
                  if ($this->show_prices == '1') {
                     if( $product->prices['discountedPriceWithoutTax'] ):
                        echo '<span style="text-decoration: line-through;">' . $this->currency->createPriceDiv('basePriceWithTax', '', $product->prices) . '</span>'
                        . number_format( (float)$product->prices['discountedPriceWithoutTax'], 2, ',', '' ) . ' €';
                     else:
                        if ($product->prices['salesPrice']<=0 and VmConfig::get ('askprice', 1) and  !$product->images[0]->file_is_downloadable) {
                           echo JText::_ ('COM_VIRTUEMART_PRODUCT_ASKPRICE');
                        }
                        echo $this->currency->createPriceDiv('basePriceWithTax', '', $product->prices);
                        echo $this->currency->createPriceDiv('taxAmount','TPL_GK_LANG_VM_INC_TAX', $product->prices);
                     endif;
                  } ?>
               </div>


But I have another problem. Articles in category view show the final price Exclude VAT. I want to show the price and discount rates. As with the prices on the items.

I'd shown the full price and the discounted price with tax.

http://clon.ottro.com/rebajas

http://clon.ottro.com/rebajas/camiseta-lipsy-cristales-swarovski-negra-detail

Thanks again for your help.
User avatar
Junior Boarder

teitbite
Wed Mar 26, 2014 5:47 pm
Reply with quote
Report this post
Hi

I'm not sure, but I belive You just need to replace in this part

Code: Select all
number_format( (float)$product->prices['discountedPriceWithoutTax'], 2, ',', '' )


this "discountedPriceWithoutTax", to "salesPrice".
User avatar
Moderator

GK User
Wed Mar 26, 2014 6:52 pm
Reply with quote
Report this post
Hi, I tried your solution and it works. But there is another problem. Articles in which there is no discount, the Category view displays two identical prices. One crossed and one without cross. I would like no discount on items only see a price.

How I can do to make it look like in the default Virtuemart. Virtuemart shows only two prices if they are different.

http://clon.ottro.com/marcas

http://clon.ottro.com/rebajas

Thank you very much,
Javier
User avatar
Junior Boarder

teitbite
Thu Mar 27, 2014 7:37 pm
Reply with quote
Report this post
Hi

In the code I gave You before make one more change. Replace line:

Code: Select all
if( $product->prices['discountedPriceWithoutTax'] ):


with:

Code: Select all
if( $product->prices['discountedPriceWithoutTax'] != $product->prices['salesPrice'] ):
User avatar
Moderator

GK User
Fri Mar 28, 2014 10:03 am
Reply with quote
Report this post
Hello, I followed your instructions. But it has not worked. I still see two similar prices.

Here's the code I used:

Code: Select all
<?php
                  if ($this->show_prices == '1') {
                     if( $product->prices['discountedPriceWithoutTax'] != $product->prices['salesPrice'] ):
                        echo '<span style="text-decoration: line-through;">' . $this->currency->createPriceDiv('basePriceWithTax', '', $product->prices) . '</span>';
                        echo number_format( (float)$product->prices['salesPrice'], 2, ',', '' ) . ' €';
                     else:
                        if ($product->prices['salesPrice']<=0 and VmConfig::get ('askprice', 1) and  !$product->images[0]->file_is_downloadable) {
                           echo JText::_ ('COM_VIRTUEMART_PRODUCT_ASKPRICE');
                        }
                        echo $this->currency->createPriceDiv('basePriceWithTax', '', $product->prices);
                        echo $this->currency->createPriceDiv('taxAmount','TPL_GK_LANG_VM_INC_TAX', $product->prices);
                     endif;
                  } ?>


Items without discount

http://clon.ottro.com/marcas

Items priced discount:

http://clon.ottro.com/rebajas

I feel my insistence, but correctly display the discounted prices is very important to any seller.

Thank you very much again for your help.
Javier
User avatar
Junior Boarder

teitbite
Sat Mar 29, 2014 8:54 pm
Reply with quote
Report this post
Hi

VM got too many options for prices :) Issue was that we have used wrong price name. Here is a correct code:

Code: Select all
                                    if( $product->prices['basePriceWithTax'] != $product->prices['salesPrice'] ):
                                       echo '<span style="text-decoration: line-through;">' . $this->currency->createPriceDiv('basePriceWithTax', '', $product->prices) . '</span>';
                                       echo number_format( (float)$product->prices['salesPrice'], 2, ',', '' ) . ' €';
                                    else:
                                       if ($product->prices['salesPrice']<=0 and VmConfig::get ('askprice', 1) and  !$product->images[0]->file_is_downloadable) {
                                             echo JText::_ ('COM_VIRTUEMART_PRODUCT_ASKPRICE');
                                       }
                                       echo $this->currency->createPriceDiv('basePriceWithTax', '', $product->prices);
                                       echo $this->currency->createPriceDiv('taxAmount','TPL_GK_LANG_VM_INC_TAX', $product->prices);
                                    endif;
User avatar
Moderator

teitbite
Sat Mar 29, 2014 8:55 pm
Reply with quote
Report this post
PS: I've corrected it on Your website already, so no need to do anything.
User avatar
Moderator

GK User
Mon Mar 31, 2014 11:39 am
Reply with quote
Report this post
Thank you for your help, I applied your sulucion my site: ottro.com

It works!

http://www.ottro.com/rebajas

http://www.ottro.com/marcas

Another thing. Have you thought you implement this option in future updates of the template?

It would be very useful to show the two prices in the category view when there are discounts.

Best regards.
Javier
User avatar
Junior Boarder

teitbite
Mon Mar 31, 2014 8:47 pm
Reply with quote
Report this post
Hi

This is mostly a VM code, we have just created a style for it, but as You can see many of modifications can be done via template files, so I'll pass this request to progrmmers.
User avatar
Moderator

GK User
Wed May 14, 2014 8:18 am
Reply with quote
Report this post
Hey, we need to do exactly the same to our website, can you help us do it? Coz I've tried to change the default.php under category under view folder but it doesn't make any change. Can you please help? It's urgent. Cheers!
User avatar
Junior Boarder

teitbite
Wed May 14, 2014 7:42 pm
Reply with quote
Report this post
Hi

Of course I'll help, please just tell me exactly what You have in mind, since couple of changes were mentioned in this thread and send me an access to ftp and site url.
User avatar
Moderator

GK User
Thu May 15, 2014 6:54 am
Reply with quote
Report this post
Thanks! Sent!
User avatar
Junior Boarder

GK User
Thu May 15, 2014 2:27 pm
Reply with quote
Report this post
It would be really good to get it done today! Our client has been pestering crazily, haha! Thanks a lot! Look forward to hearing from you!
User avatar
Junior Boarder

teitbite
Thu May 15, 2014 9:11 pm
Reply with quote
Report this post
Hi

It's done, please check. Please next time do not bump Your own thread, it moved Your requesto to the end of the line and took me couple more hours to get to it.
User avatar
Moderator

GK User
Fri May 16, 2014 6:55 am
Reply with quote
Report this post
Thanks a lot! But sorry, it shows EUR now? I need to show norwegian kroner...Can you please help again?

BTW, where should I edit myself if I need further changes?
User avatar
Junior Boarder

teitbite
Mon May 19, 2014 8:51 am
Reply with quote
Report this post
Hi

Sorry for delay I got sick and could not answer earlier.

All modifications I've done was to /html/com_virtuemart/category/default.php , please take a look into this code. Euro sign is added in code, so You just need to replace it with Yours.
User avatar
Moderator


cron