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

TOPIC: Category & Manufacturer Title issues?

Category & Manufacturer Title issues? 8 years 3 months ago #6655

I have some issues that can be covered within one forum post & may need some custom support if you can afford the time to help me?
I modified the category template some time ago so that the manufacturer description displays on manufacturer products pages.
This modification was done in puremart 3.4 and carried through to the latest version were we are now running vm 2.0.22c & puremart 3.8 - see below for the code modifications

1 - Manufacturer Title.
If all site and browser cache is cleared and you visit our site and view a manufacturer page. More often than not the manufacturer title will not show for the page. but upon refreshing the manufacturer title shows up OK.

2 - Category Details
I'm assuming because of the modification, now when we add a category description, this also shows in brand/manufacturer pages above the manufacturer title. Even though the category description may have nothing to do with that brand/manufacturer at all.
Ive attached a screenshot of the about brand link. the highlighted text, is from another category & should not be displayed here.

If I have messed up with my modifications or they are not compatible with latest versions of puremart & vm2.0.22c then this is what I want

1 - Category/brand title to always show at top/1st place & then the descriptions
2 - In Manufacturer product details pages, I want the manufacturer description to be displayed, below the title.

Thanks Andy

This is a chunk of code from puremart/com_virtuemart/category/default.php around line 177. You can my modification commented.
/ Separator
$verticalseparator = " vertical-separator";
?>
 
<!-- Removed & Added to the top of this file so that titles always display in the first/top position 
<?php if ($this->search ==null) { ?>
	<div class="FlexibleCategiryTitle">
		<span class="FlexibleCategiryTitleSPAN"><?php echo $this->category->category_name; ?></span>
  </div>
<?php } else { ?>
	<div class="FlexibleCategiryTitle">
		<span class="FlexibleCategiryTitleSPAN"><?php echo JText::_('COM_VIRTUEMART_SEARCH') ?>: <?php echo $this->keyword; ?></span>
    </div>
<?php } ?>	 -->
 
      <!--ConCom Add Manufacturer Description-->
<?php
$jinput = JFactory::getApplication()->input;
 $trigger="virtuemart_manufacturer_id";
 $mid = $jinput->get->get($trigger);
 if (!empty($mid))
{
 
echo '<div class="manufacturer-description" style="font-size:12px;">';
   echo '<p>'.$this->products[0]->mf_desc.'</p>';
echo '</div>';
}
?>   
   <!--ConCom END Add Manufacturer Description-->
 
			<div class="orderby-displaynumber">
				<div class="width60 floatleft">
Last Edit: 8 years 1 month ago by Andy Connell.
The topic has been locked.

Category & Manufacturer Title issues? 8 years 3 months ago #6673

Hi,


I browsed your website (Manufacturer: Reflex, www.bodyactive-nation.co.uk/manufacturer/reflex) But i don't see the extra description that you highlighted in your screenshot.

Attachment ScreenShot2013-10-02at6.22.12AM.png not found



Did you manage to solve your problem by yourself?

Regards.
The topic has been locked.

Category & Manufacturer Title issues? 8 years 3 months ago #6691

No, this has not been solved.

We only have 1 category with a description,

If you visit that category first & then view a manufacturer/brand, the description of the category shows as well as the manufacturer description.

Thanks,

Andy
Last Edit: 8 years 1 month ago by Andy Connell.
The topic has been locked.

Category & Manufacturer Title issues? 8 years 3 months ago #6715

Hmm,

Virtuemart thinks you are still in that previous category page and prints the category description as well. Very hard to notice at the first point.

Anyway, you can tackle this problem by this:
Open this PHP file:
/templates/YOUR_TEMPLATE/html/com_virtuemat/category/default.php
(default.php or flexv2.php depends on which layout you are using currently for category page)

and look for this line:
<div class="category_description">
	<?php echo $this->category->category_description ; ?>
	</div>

and replace it with this:
<?php 
		$manufacturerCheck = JRequest::getVar('virtuemart_manufacturer_id');
		if (empty($manufacturerCheck)) { ?>
		<div class="category_description">
			<?php echo $this->category->category_description ; ?>
		</div>
    <?php } ?>


If you are in the manufacturer page the "virtuemart_manufacturer_id" variable will be defined (with the manufacturer ID) in the URL, for instance:
/index.php?option=com_virtuemart&view=category&virtuemart_manufacturer_id=3

So by the PHP lines above, the category description will be printed depends on whether the virtuemart_manufacturer_id is empty or not.

In category page: virtuemart_manufacturer_id variable is blank, so the category description will be printed.
In manufacturer page: virtuemart_manufacturer_id is defined, so the category description will be hidden.

I am sure this trick will work for you.

Regards.
Support & Development
Last Edit: 8 years 3 months ago by Support.
The topic has been locked.

Category & Manufacturer Title issues? 8 years 3 months ago #6751

Thanks for providing such a clear & descriptive explanation (again).
This is what really sets "Flexible" apart from others & really appreciate it! Will this fox be added to future versions of puremart? Or do i need to make a note of ot for upgrades?

I was at JoomlaDay UK last weekend & I showed your templates to a couple of guys who were thinking of using VM2 but were a bit unsure of what template developer to go to! So you may have a couple new customers in the next few days :)


Anyway, your code & explanation seemed to fixed that specific problem but my original problem 1 still exists (copied below).

When viewing manufacturer pages from our Brands dropdown menu, sometimes the brand/manufacturer title doesnt show, upon refreshing it then shows up OK. This is same in all browsers.

Any ideas for this one? Is it worth me adding my category/default.php file ?

The only modification I have made is to add these lines of code to display the manufacturer description in manufacturer product pages.
<!-- Add Manufacturer Description-->
<?php
$jinput = JFactory::getApplication()->input;
 $trigger="virtuemart_manufacturer_id";
 $mid = $jinput->get->get($trigger);
 if (!empty($mid))
{
 
echo '<div class="manufacturer-description" style="font-size:12px;">';
   echo '<p>'.$this->products[0]->mf_desc.'</p>';
echo '</div>';
}
?>   
<!-- END Add Manufacturer Description-->


1 - Manufacturer Title.
If all site and browser cache is cleared and you visit our site and view a manufacturer page. More often than not the manufacturer title will not show for the page. but upon refreshing the manufacturer title shows up OK. bit.ly/YbvaAV
Last Edit: 8 years 3 months ago by Andy Connell.
The topic has been locked.

Category & Manufacturer Title issues? 8 years 3 months ago #6767

- Can't thank you enough for your thoughts about FlexibleWD. We always try to do our best.

- That fix shouldn't be added to PureMart permanently because no need to. Officially; Virtuemart doesn't print the manufacturer description on the browse page, so there won't be any conflict. That patch is only for your case specifically.

- About your last remaining issue, I didn't experience that kind of problem on your website. I browsed your website, jumped to coupole other BRANDs (through the 1st menu item), but didn't see the problem you are talking about. The titles were always there correctly. (or may be i misunderstood you)

Also try to disable SEF URL temporarily and check if you experience the same issue. That kind of unsteady behaviors are usually related to SEF URL's (because of the itemID)

Regards,
Support & Development
Last Edit: 8 years 3 months ago by Support.
The topic has been locked.

Category & Manufacturer Title issues? 8 years 3 months ago #6852

support wrote:
- About your last remaining issue, I didn't experience that kind of problem on your website.

Also try to disable SEF URL temporarily and check if you experience the same issue.

Hi, I use a dedicated server with siteground, who are awesome for Joomla sites, so in my main site I use there own supercache tool and a cloud CDN, so I thouht this maybe causing the problem.
I created a clone/staging site with all cache & CDN switched off, but I am still getting the problem with the manufacturer title.
I also switched all Jooma SEF & SH404SEF and still I get this problem.

This happens in all the browser I checked with (Safari, FF & Chrome) & normally only happens when the cache is clear, after refreshing the title shows up OK and then when viewing brand pages the title shows up OK too?

I would really appreciate if you can afford some time to take a depper look at this for me, even if it is as a paid support request.

I can send you details of the clone site or a copy of the category.php file I am using

Thanks in advance,
Andy
Last Edit: 8 years 1 month ago by Andy Connell.
The topic has been locked.

Category & Manufacturer Title issues? 8 years 3 months ago #6861

Hi,

here is my first experience, please guide me on this about what to do next:

Right now, i am suing Firefox, I clicked the link you gave me and i am seeing the "Reflex" title at the top.
I know, i have visited your website previously with using this browser (firefox), so i opened my Chrome browser (which i barely use, only for cross-browser testing of my works) And the result is the same.

What am i supposed to do right now to remove the "Reflex" title from the top? Because i need to see the failure first. Should i clear the cache? But i already browsed your website with a browser that has never visited your website before (with my Chrome) and the title is still there. That means, i am a freshman to your website and i don't see any title problem at all.

Should i click somewhere, and then click somewhere else to see this failure? just like how it was with your previous inquiry?

Regards.
The topic has been locked.

Category & Manufacturer Title issues? 8 years 2 months ago #7232

I have done several tests now and this problem still exists & is now driving me mental!
So here is a step by step approach to how to duplicate it. Also I have have recorded the following steps on a screen capture and uploaded it to VIMEO here

It seems this is easy to duplicate if you 1st clear your browsers cache and then view any of the brands by clicking from the menu in the Home page > Brands > choose any brand - see the video.

If you refresh that brand or visit a brand page link from within a brand page, then the menu generally shows up - again shown in the video

As you will see in the steps below and in the video, I also tried this in an exact copy of the site on the same server.
But the copy has all site cache, CDN & SEO switched off.
Also I use jQuery easy and this is switched off in this copy/test site.
AND I also switched out my site template and tested with BEEZ2, with the same results.

1 - Sites Cache is all switched off and cleared
2 - Chrome cache is all cleared
3 - From home page view any brand - On Brand page you will not see a title
4 - From the brand page refresh or visit another brand page and you most likely now see the title.
5 - Go back to home page and visit a different brand & you again will not see the title.

Another Test - I used a copy of the site with all site cache disable, CDN disabled and SEO disabled and the same thing happens.
www.staging5 is the staging site and following the same steps above shows the same results.


As in previous post, I would really like you to take a look deeper into this for me as I have modified the template slightly in order to show this Manufacturer title and description. & Happy to pay for your time as a custom support job.


Andy
Last Edit: 8 years 1 month ago by Andy Connell.
The topic has been locked.

Category & Manufacturer Title issues? 8 years 2 months ago #7268

Hi,

I watched the video, it shows the problem crystal clear.
First of all, I think it has nothing to do with the cache. So stop clearing your browser cache or website cache for testing.

Because if you click the "Brand" name from the homepage, the title is missing, but once you refresh the page (or jump to another brand), it shows the title.

I think this weird behavior is directly related to "the page where you linked to manufacturer page".
From homepage -> no title
From manufacturer page -> title is there. (refreshing page also falls into this category)

This PHP line you used:
 $jinput = JFactory::getApplication()->input;
 $trigger="virtuemart_manufacturer_id";
 $mid = $jinput->get->get($trigger);
....

Looks very suspicious to me. Because JFactory::getApplication()->input; is used to get input values. It is just an another way getting values, instead of getting them from ordinary GET or POST requests.
docs.joomla.org/Retrieving_request_data_using_JInput

I don't understand the idea of using jInput for this case. I don't know what the author has thought while writing those lines. I am sure the issue you are having is directly related to jInput usage.

Did you also rise this issue in the forum.virtuemart.net ? I believe you got that custom PHP lines from the forum.virtuemart.net.

I think the best person to give you any solution is the one who wrote those PHP lines. Because only "he" knows why he used jInput, i guess ;)

Regards,
Support
The topic has been locked.

Category & Manufacturer Title issues? 8 years 1 month ago #7330

I don't actually have any communication with the guy that wrote this for me.
Would you guys like to look at it as a custom job & maybe just rewrite those lines completely?

All I want is to display the manufacturer description within the manufacturer product pages!
Description to sow below the title and above the products? I then create a manual menu to point to these pages.

Please let me know if you have time to look at this and how we go about setting up a custom job for you.

Thanks in advance, Andy

This is the current lines of code I use to display the manufacturer description in the manufacturer product pages. This is added in my puremart files/category/default.php.
<?php
$jinput = JFactory::getApplication()->input;
 $trigger="virtuemart_manufacturer_id";
 $mid = $jinput->get->get($trigger);
 if (!empty($mid))
{
 
echo '<div class="manufacturer-description">';
   echo '<p>'.$this->products[0]->mf_desc.'</p>';
echo '</div>';
}
?>
Last Edit: 8 years 1 month ago by Andy Connell.
The topic has been locked.

Category & Manufacturer Title issues? 8 years 1 month ago #7338

Hi,

Did you see this topic below?
forum.virtuemart.net/index.php?topic=102062.0

Looks like somebody provides a custom code to achieve exactly what you are looking for, and some another guy says "it works".
It uses the jInput too, but it includes bunch of other lines as well.

Try it and see if those are the custom lines you are looking for.

Regards,
Support
The topic has been locked.

Category & Manufacturer Title issues? 8 years 1 month ago #7339

Thanks, I hadn't seen that Virtuemart forum post, & it does sound like what I need, but also looks similar to what I already have.

I just implemented and tested it in a new carbon copy of my site & it produces the exact same results as I already get with my current setup.
From homepage -> no title
From manufacturer page -> title is there.


This has worked OK for me in the past.
It's only since updating to VM2.0.22 & to Puremart 3.8 (from3.4) a few weeks back, have the problems occurred.

So do you think that using "$jinput = JFactory::getApplication()->input;" is causing problems now we have updated things?
Last Edit: 8 years 1 month ago by Andy Connell.
The topic has been locked.

Category & Manufacturer Title issues? 8 years 1 month ago #7344

Hi,

Yes, I strongly believe the usage of jInput is the source of the problem you are having.

Because using jInput is something to do with the previous page and the the problem you are having is directly related what referral page is. So they match...

You know.. in php, if you build a form mail on the contact page, There are 2 PHP pages; the 1st page will have inputs fields (name, email, message) and the 2nd page will be the "thank you page". In this thank you page, the inputs values will be sent to your email. To gather those values from the previous page; JFactory::getApplication()->input; will be used --- or in ordinary PHP <?php echo $_GET["name"]; ?> will be used --- I guess the author has manipulated the real usage of jInput and used it to check if the page is "Manufacturer page" or the "Category page".

There must be an another way to do the same thing without using the Input. I can't think anything right now though. Keep digging and rise this issue in the Virtuemart forum. I am sure somebody will answer you.

Regards.
Support & Development
The topic has been locked.

Category & Manufacturer Title issues? 8 years 1 month ago #7350

Thanks for your time & patience with me, I learned a few new things along the way, but for now, it looks as though this is OK.

I posted in the VM forum that you found (Thanks Again). And teh guy that wrote the code P2 Peter (who ive spoke with before actually) responded pretty quickly informing me that this problem happened with him when using 2.0.22 series and updating to 2.0.24 sorted hos problem.
He also pointed me to the possible problem with the variable $categoryId = ShopFunctionsF::getLastVisitedCategoryId(); in the file \components\com_virtuemart\views\category\view.html.php

For now I just swapped this file from 2.0.24b into the same location in my site, which seems to have solved the problem.

But I will definitely look into removing the JFactory::getApplication()->input; as you recommended.

Thanks again, great work & I will continue to recommend you to other Joomlaholicas at J Days & JAB next year in Germany
The topic has been locked.

Category & Manufacturer Title issues? 8 years 1 month ago #7366

I am glad you figured that out and everything works as expected.

Since this case is resolved, I am closing this topic and marked as solved for forum clearance.
I hope others who are willing have the same modification will also get benefit from this topic.

Regards,
Support
The topic has been locked.
Time to create page: 0.602 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