Author Topic: Don't show products not associated to categories / Don't show certain products  (Read 121 times)

Huubs

  • Jr. Member
  • **
  • Posts: 103
Hello,

I have a couple of products that I only want to be orderable with products. These products should not be accessible in their product details page so to speak. So I made these products and didn't give them a category. But I can still click on its name in the cart and it will take me to the product page.

Is it possible to disable these things? Or do I need to make some sort of hack that doesn't allow the product to have a paying method nor a shipping method and thus cannot be bought?

EDIT: Maybe make a certain category that is not accesible? That is also an option, to make a certain category (NOT-ACCESSIBLE) that you hide from google and the visitors of the website

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 3248
  • Joomla & Virtuemart addon developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3.0.x.y
Hi,
You can modify the order and cart layout and remove the URL to product.
Eg for cart yoursite/components/com_virtuemart/views/cart/tmpl/default_pricelist.php
Change
Code: [Select]
echo JHtml::link ($prow->url, $prow->product_name);To
Code: [Select]
echo $prow->product_name;Another solution is to add redirect rules, if you dont have not to many products to redirect.
Last solution, is to add a redirection in product when no categories are set and product have no parent.

Huubs

  • Jr. Member
  • **
  • Posts: 103
Hi,
You can modify the order and cart layout and remove the URL to product.
Eg for cart yoursite/components/com_virtuemart/views/cart/tmpl/default_pricelist.php
Change
Code: [Select]
echo JHtml::link ($prow->url, $prow->product_name);To
Code: [Select]
echo $prow->product_name;Another solution is to add redirect rules, if you dont have not to many products to redirect.
Last solution, is to add a redirection in product when no categories are set and product have no parent.

Ok awesome. I think that is a good solution to redirect these products to other products. Now there is 1 last thing that needs to be addressed.

For example when you order the product with the extra products, you can remove the main product and the extra products stay in the cart. Now these products cannot be ordered without the main product. Is there a solution to remove these products as well from the cart or do you have another solution for that?

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 3248
  • Joomla & Virtuemart addon developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3.0.x.y
To remove unwanted products, if you have always same rule(eg product having no categories), you need to call the cart helper delete function with a plugin for eg.

StefanSTS

  • Global Moderator
  • Jr. Member
  • *
  • Posts: 125
  • VirtueMart Version: VM 4.2 on Joomla 4.5
A question first:
Do you really need the additional product to be a VirtueMart product?
If you don't control your stock with VirtueMart there might be a simpler solutions that works well.

You could make a product:
Main Product
-> just add a custom field "string" with
- no additional product
- additional product 1
... or more, if the customer can choose between additional products.

You could also make a parent product.
Main Product
- add child products: Main Product + no additional product
- add child products: Main Product + additional product 1
- add child products: Main Product + additional product 2

This way you don't have to modify anything and no trouble in future.

Stefan
--
Stefan Schumacher
www.jooglies.com - VirtueMart Invoice Layouts