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

TOPIC: Using Themes Extra Tabs for other custom fields

Using Themes Extra Tabs for other custom fields 11 years 2 months ago #2530

I am moving a large site from VM1 to VM2.
In VM1 I Hacked/created some extra custom fields which I am importing over and the will be set up as custom fields against each product.
They will just be a text field, custom field.
One of which is just a list of Questions & Answers & the other is a Usage instructions - Both individually specific to each product.

Each of these will be added at parent level and what I wanted to know was;

Using the extra tabs I found in the Flexible VM plugin, can these tabs bring in the data from these custom fields for each individual product?
So If the custom field was named "FAQ" can I add in some php or other code to the plugin for tab 1, so that the contents of the text area custom field for each specific product is added within the tab?

Could this be done with the help of using some of NoNumber plugins components?


Also what I wanted to ask, is can the plugin be modified to add an extra 3rd Tab.

Thanks in advance,

Andy
The administrator has disabled public write access.

Using Themes Extra Tabs for other custom fields 11 years 2 months ago #2548

I have no idea what you are talking about.

As far as i know, custom fields don't get migrated from VM1 to VM2.
Because the structure has been changed completely. If you manage to do it somehow then good for you.

You can define a new TAB and make it appears in the TAB section at the bottom of product details page. But you would need to give a layout value to those custom fields, let's say; layout:FAQ, then in the product details you can check the custom fields with a IF..END

(see the product details page PHP:
ROOT/templates/<yourjoomlatemplate>/html/com_virtuemart/productdetails/default.php
There are some samples in this PHP file to give you an idea about it, for instance this:
<?php if (!empty($this->product->customfieldsSorted['ontop'])) { ?>
a Custom field is exist for this product which has a "ontop" layout.
<?php } ?>

Basically you are going to use FAQ, instead of ONTOP. if there is any custom field with the FAQ layout for that product, that custom field can be printed in the TAB (just like how we did with the "specifications" TAB). you don't need to use those custom TAB that comes with pureMart, you can create your own.

But this is a custom modification. And our Free support doesn't cover any custom modification.
If everything works in your website as you see in our DEMO, our free support ends there.

Regards.
Forum Support.
Last Edit: 11 years 2 months ago by Support.
The administrator has disabled public write access.

Using Themes Extra Tabs for other custom fields 11 years 2 months ago #2553

I have no idea what you are talking about.
LOL! Sorry for the confusion, I thought when I typed up the post that may confuse.

Basically, I think you figured out what I want.
I will be adding text area custom fields for extra Information about the product, which I wanted those to show up in the bottom tabbed area. I will take a deeper look as per your example.

I know this is slightly beyond the realms of getting the template to display as your demo and getting into custom modification.
If you offered custom modification I would be happy to pay the going rate or I would equally be happy to pay for an advanced support package if you ever thought of offering that in the future as your support is always VERY informative, helpful & I generally go away feeling like Ive learned something! Its amongst the best support Ive come across in Joomla!
That is why I opted to purchase the full license for the templates Ive purchased.
The administrator has disabled public write access.

Using Themes Extra Tabs for other custom fields 11 years 2 months ago #2569

Hi,

Yes, we do have premium support option. And, i am, personally, responsible with that premium support.
But you know what is the drawback of providing this kind of detailed free support to all of our clients?
I have absolutely no free time. I am spending all my time in providing support here in this forum daily. And usually it is not even enough ;) But i am pushing my limits to provide solutions or give responds at least within 24 hours after the question is asked.

Unfortunately the premium support is not the case these days. We are hiring one more guy to take care of our forum area, we are still looking, haven't found a Virtuemart expert yet. Once we manage to do it, i will be pretty much available and will be able to accept premium support question and make the custom changes in our client's website. There are lots of people like you, they are willing to pay, but i won't want them to get disappointed with a delay, so i am refusing all of them. Sorry.

Try what i have said previously. if you stuck somewhere, you can ask my help here. I would be glad to assist you.

Regards.
Forum Support.
The administrator has disabled public write access.

Using Themes Extra Tabs for other custom fields 11 years 2 months ago #2910

As per your last post I'm back for a little assistance please :o(

I am trying to add some new bottom tabs to show some custom field information.

I have Custom field text area set up - with "faq" as the layout position
& I have a product with some content in that custom field

Towards the bottom of the product detail template I have added this, from your advice? but am guessing there is a problem with the 3rd line? Just not sure what?
	<?php if (!empty($this->product->customfieldsSorted['faq'])) { ?>
	<div id="faq" class="tabcontent" style="display:none;">
	<?php  echo $this->loadTemplate('customfields' ); ?>
	<?php } ?>
	</div>

EDIT:

I just noticed in the product detail template the tabs seem to be set out via <ul> <li> Guess I need something here to that will link to my code above?

I added;
<li><a href="javascript:void(0)" rel="#faq"><span>FAQ's</span></a></li>

which shows up my FAQ tab, but I don't know now where to go now to link the 2 together.
Last Edit: 11 years 2 months ago by Support.
The administrator has disabled public write access.

Using Themes Extra Tabs for other custom fields 11 years 2 months ago #2938

Yes, you got it.

You need to insert 2 different lines in to 2 different places.

One within the <ul>... </ul> to load the TAB button.
And one for the content (the content that shows off when the TAB button is clicked.)

Take the "ask a question" TAB as your role model. Basically duplicate it.
Look for this line:
<?php if (VmConfig::get('ask_question', 1) && $params->get('productdetails_ask_tab',1)) { ?>
            <li><a href="javascript:void(0)" rel="#askquestion"><span><?php echo JText::_('COM_VIRTUEMART_PRODUCT_ASK_QUESTION'); ?></span></a></li>
<?php }?>  

And above it ( or below it) add these lines:
<?php if (!empty($this->product->customfieldsSorted['faq'])) { ?>
<li><a href="javascript:void(0)" rel="#faq"><span>FAQ</span></a></li>
<?php } ?>  

You just added the TAB button with the title of FAQ. Now you need to add the content of this FAQ.
Scroll down little bit, and find these lines. These are for "Ask Question" but you are going to duplicate them and create a content area for your FAQ.
<?php if (VmConfig::get('ask_question', 1) && $params->get('productdetails_ask_tab',1)) { ?>
	<div id="askquestion" class="tabcontent" style="display:none;">
	<?php	echo $this->loadTemplate('askquestionform'); ?>
    </div>
<?php } ?>

And above it ( or below it) add these lines:
<?php if (!empty($this->product->customfieldsSorted['faq'])) { ?>
    <div id="faq" class="tabcontent"  style="display:none;">
	<?php $this->position='faq';
		echo $this->loadTemplate('customfields'); ?>
        <div class="clear"></div>
    </div>
	<?php } ?>    


This should work out if you do it correctly.

Important: Don't publish/attach your PHP file entirely here. This forum is open to public, you are actually publishing our copyrighted PHP scripts

Regards.
Forum Support.
Last Edit: 11 years 2 months ago by Support.
The administrator has disabled public write access.

Using Themes Extra Tabs for other custom fields 11 years 2 months ago #2948

Awesome Help & Support. I'm really grateful, Thanks!

I can't believe how close I got!
Feel like I've really learned something new.

Ive added 3 new tabs in place, and there showing up great!

Important: Don't publish/attach your PHP file entirely here. This forum is open to public, you are actually publishing our copyrighted PHP scripts
I'll remember this in future, thanks.
I guess you removed my attachment.
Last Edit: 11 years 2 months ago by Andy Connell.
The administrator has disabled public write access.

Using Themes Extra Tabs for other custom fields 11 years 2 months ago #2953

I want to do something similar with Top Tabbed area, but again running into brick walls.

1 -I want to add another top tab to display this information inside it;
<div class="FlexibleProductDetailsSpecialNote">
    <?php
                // Converts cost of product to display a number without decimals
                // & rounded down - equal to number of loyalty point s user will be awarded
                // This then shows as number for users information
 
echo round ($this->product->prices['basePrice'])
 
     ?>
    Loyalty Points with this product</div>


I have this again for the first bit - this is displayed in EVERY product page
<!-- ConCom Extra top tab for loyalty points-->       
            <li><a href="javascript:void(0)" rel="#points"><span>Points</span></li>

And this for the bit a few lines below;
<?php if (!empty($this->product->points)) { ?>
		<div id="points" class="FlexibleProductTABDetails" style="display:none;">
    <?php
                // Converts cost of product to display a number without decimals
                // & rounded down - equal to number of loyalty point s user will be awarded
                // This then shows as number for users information
 
echo round ($this->product->prices['basePrice'])
 
     ?>
    Loyalty Points with this product
        <div class="clear"></div>
		</div>
	<?php } // Product customfieldsRelatedProducts END?>

I'm obviously going somewhere wrong again :o(
Last Edit: 11 years 2 months ago by Andy Connell.
The administrator has disabled public write access.

Using Themes Extra Tabs for other custom fields 11 years 2 months ago #2960

You'll have to wait till the boss is back.. ;) US Pacific time

Cheers

John
The administrator has disabled public write access.

Using Themes Extra Tabs for other custom fields 11 years 2 months ago #2995

Thanks & I appreciate that this is away from the support that you give for the template.
I definitely owe you a beer or 3!
The administrator has disabled public write access.

Using Themes Extra Tabs for other custom fields 11 years 1 month ago #3026

Hi Andy,

Your questions have exceed our "free support" limit, and i am sure you are aware of that.
But here is your TIP:

To add it to TOP-TAB section,

The <li>..</li> must be something like this:
<li><a href="javascript:void(0)" rel="#points"><span>Points</span></li>
In this line, the rel="" attribute represents the designated DIV's ID attribute, got me?
So in order to point out this button to appropriate content, DIV element must be this:
<div id="points" class="FlexibleProductTABDetails">
 
	... the content goes here...
 
</div>

So as i am seeing in your codes, you did it correctly. What went wrong?
The TAB doesn't work? Or the doesn't show correct values inside the content?

You should also better be using:
$this->product->prices['salesPrice']
or
$this->product->prices['priceWithoutTax']

Because BasePrice doesn't include the discount. (in case you might apply some discount to your products)

About this code:
echo round($this->product->prices['basePrice']);

You can use round() function of PHP to round the number to closest integer number (4.51 becomes 5, and 4.49 becomes 4)

BUT this line in your code:
if (!empty($this->product->points)) {

Doesn't make any sense to me, what is product->points and where did it come from? Are you using a 3rd party extension? Virtuemart doesn't have a "points" variable.

This calling will return you "EMPTY" value, since your IF function is
!empty

And this returns an empty result, this means, the content will never be printed.

Replace it with this (don't use IF at all):
<div id="points" class="FlexibleProductTABDetails" style="display:none;">
    <?php
                // Converts cost of product to display a number without decimals
                // & rounded down - equal to number of loyalty point s user will be awarded
                // This then shows as number for users information
 
echo round($this->product->prices['salesPrice']);
 
     ?>
    Loyalty Points with this product
	<div class="clear"></div>
</div>

Regards.
Forum Support.
Last Edit: 11 years 1 month ago by Support.
The administrator has disabled public write access.
Time to create page: 1.226 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