Welcome, Guest
Username: Password: Remember me
Use this Category for your support questions about Virtuemart Template - PureMart (SKU# FLEX-00010)

TOPIC: Different Offer boxes for different products

Different Offer boxes for different products 11 years 2 months ago #2272

Hello,

At first I have to say that PureMart is the best VM2 theme on the market, it might give VM2 a new beauty.
Specially the simple structure of it is suitable for newbies like me.

I have got questions and hope their might be answers,

Q. How could I configure the "Special Offer Box" to put different data/information for different products? With the default configuration an unique information is being displayed for all products. If it is not possible then I shall have the second question;

Q. How to publish a Custom position at the same position where "Offer Box" Published?

Thank you

Khan Habib
The administrator has disabled public write access.

Different Offer boxes for different products 11 years 2 months ago #2281

Hi,
Thanks for your compliments about PureMArt, i am glad you love it.

Unfortunately your 1st it not possible. You can't believe how many brilliant ideas that we have been trying to bring to Virtuemart (including this one) but it is not practically possible, because this filtering can be only possible through Virtuemart Backend. There can be a "checkbox" in the backend, something like: "show special offer: YES/NO"
BUT, the problem is; template overriding doesn't work in Virtuemart backend. Some core files of Virtuemart need to be modified (which we don't recommend and never ask from people, unless it ia very very very tiny thing..) Modifying Virtuemart backend core file is not secured and eventually those modified files will be retrieved back to factory settings once the Virtuemart is updated.

We are trying our best to implement things to Virtuemart without touching how the Virtuemart and its backend works. But as you might guess, there is a limit. We can't go beyond that limit. Filtering the "special offer boxes" for certain categories or certain products is just one of them. And there is no practically solution i can offer you now (if there was, we would do it that way).

About the other question, you will need some coding changes (within our VM Template - PureMArt).
Open this PHP file:

ROOt/templates/<yourjoomlatemplatefolder>/html/com_virtuemart/productdetails/default.php
(Default.php or flexv2.php... depends on which ever product layout you are using currently).
Then find this line:
<?php 
	 $SpecialText = $params->get('productdetails_special');
	 if (!empty($SpecialText)) { ?>
     	<div class="FlexibleProductDetailsSpecialNote"><?php echo $SpecialText; ?></div>
     	<div class="clear"></div>
        <Br/>
<?php } ?>

Remove these lines from where they are and paste them to any where you want to show the "special offer" box.

If you are good at PHP, you can do this and it will be your solution for your 1st question (it is not practical but at least it will work) so it will be shown only in products that belongs to certain categories. Lets say, you want to show that special offer box only in 2 categories, first figure out those CATEGORY ID's (from Virtuemart Back-end), let's say their IDs are 10 and 11. If you re-modify the above PHP IF...END with this:
<?php 
	 $SpecialText = $params->get('productdetails_special');
	 if (!empty($SpecialText) && ($this->product->virtuemart_category_id=10 || $this->product->virtuemart_category_id=11)) { ?>
     	<div class="FlexibleProductDetailsSpecialNote"><?php echo $SpecialText; ?></div>
     	<div class="clear"></div>
        <Br/>
<?php } ?>

So the special offer box will appear only if;
- Special text field is not empty
- Product's category's ID number is either 10 or 11

You can also do that with filtering with including $this->product->virtuemart_product_id but it will be a lot time consuming, since you need to define each product individually.

Regards.
Forum Support.
The administrator has disabled public write access.
Time to create page: 0.165 seconds

MaterialMart

for Virtuemart 3

Google's Material Design has finally arrived to Virtuemart

Virtumart Template - MaterialMart Virtumart Template - CleanMart Virtumart Template - CleanMart Virtumart Template - CleanMart

Fully responsive!

Buy Now   |   Live Demo