I am looking to provide a link on my site that takes the customer to a page that shows all the products across all categories given a specific attribute that those products are associated with. Visitors to the site can already refine their search by attribute within a category by using the attribute filter but this is not what I'm trying to accomplish. I've searched for an extension but can't fine anything (as far as I can tell) that matches this need. Anyone have any info or advice would be really appreciated.
if you want to make it only with a link click you need to make it work with get parameter index.php ?route=page&attribute=x&attribute=y
Opencart Expert | voldemaras@gmail.com
Skype - programanija | Gtalk - voldemaras@gmail.com
Extensions for Opencart @ https://www.opencartextensions.eu / or Opencart Marketplace
Need Custom Module? debug third party module or simply have any question related to Opencart? feel free to contact directly for a live chat session:) - INSTANT LIVE CHAT
From what I understand, you're saying to manipulate the url string? Odd thing is I've tried this but it doesn't return anything or if it does it only returns all items in all catagories (regardless of url string).
Maybe I misunderstood what you were saying though?
Thanks for the input.
Maybe I misunderstood what you were saying though?
Thanks for the input.
This can be easily accomplished by showing all attributes associated by each products among each categories of each pages without the use of a query since a query is meant to pull specific results of a product among or without a specific category or sub-categories which is not what you're requesting in this case.Bobzor wrote: ↑Sun May 26, 2019 5:21 amI am looking to provide a link on my site that takes the customer to a page that shows all the products across all categories given a specific attribute that those products are associated with. Visitors to the site can already refine their search by attribute within a category by using the attribute filter but this is not what I'm trying to accomplish. I've searched for an extension but can't fine anything (as far as I can tell) that matches this need. Anyone have any info or advice would be really appreciated.
To do so, in catalog/controller/product/category.php file,
find:
Code: Select all
$data['products'][] = array(
Code: Select all
$product_attributes = $this->model_catalog_product->getProductAttributes($result['product_id']);
Code: Select all
'product_id' => $result['product_id'],
Code: Select all
'attributes' => $product_attributes,
Code: Select all
{% for product in products %}
Code: Select all
{% endfor %}
Code: Select all
{% if product.attributes %}
{% for attribute in product.attributes %}
... your theme code ...
{% endfor %}
{% endif %}
Since you're also looking for presentative associations, you could also do the following in the TWIG file for e.g:
Code: Select all
{% if product.attributes %}
Attribute: Yes
{% else %}
Attribute: No
{% endif %}
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Who is online
Users browsing this forum: nonnedelectari and 409 guests