Author Topic: How to show links to all categories of a product in the product page  (Read 154 times)

eu4ria

  • Beginner
  • *
  • Posts: 6
Hello! In my vm 3.4.2 (php 7.1) site each product is getting into two categories. These two categories are equivalent. Category 1 - men or women and category 2 - original or copy.
How to show links to ALL categories in a product page?
Now in the product page there is a code:
Code: [Select]
<?php echo $this->category->category_name?>This code shows only one category through which the visitor entered the page. and how to show also the second category?

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 8834
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 2.6.22 & 3.2.14
Re: How to show links to all categories of a product in the product page
« Reply #1 on: March 13, 2019, 09:11:04 am »
on the product details template in the $this->product is an array of catids



   $this->product->categories => Array
        (
           
  • => 181
  • [1] => 183
            )

    or  $this->product->categoryItem is another array containing all cat info (name, id etc)

    just loop thru and render what info u want
GJC Web Design
VirtueMart and Joomla Developers - php developers http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation