VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: peaceandlove on February 15, 2015, 04:52:01 AM

Title: How to add text/code to all produrcts at once?
Post by: peaceandlove on February 15, 2015, 04:52:01 AM
We have around 1000 products, just after heading of product we want to add a plugin code

{some code} or you can say some text to all products.

Mnaullay adding them one by one is too large task, any way to add them quick.

The code is same for all products
Title: Re: How to add text/code to all produrcts at once?
Post by: GJC Web Design on February 15, 2015, 13:26:58 PM
in the template? 
Title: Re: How to add text/code to all produrcts at once?
Post by: Milbo on February 16, 2015, 15:14:37 PM
in the template? GJC, come on.

No. The right way is to use a product Pattern (unpublished parent product). There you just add a customfield string without a check at "is input" and thats it. Is even using already the language keys so you can even make it translateable.
Title: Re: How to add text/code to all produrcts at once?
Post by: GJC Web Design on February 16, 2015, 20:43:42 PM
swings and roundabouts....  if I want the same message on a huge % of products why not stick it in a template over ride?
Title: Re: How to add text/code to all produrcts at once?
Post by: Milbo on February 17, 2015, 08:45:02 AM
Overrides are not an enduser solution. And I invested a lot so that VM needs less overrides.
Title: Re: How to add text/code to all produrcts at once?
Post by: Jörgen on February 17, 2015, 11:33:45 AM
Hello Milbo

Sorry to break in like this. I understand that the idea You are proposing sounds nice when You start with no Products. But when You have over 1000 products there would be a lot of work adding an extra text string to each product. I understand that this can be done with a sql script, but this is also no enduser solution. My guess is that You eventually might end up with som adjustments for the layout that can´t be done with CSS alone, so You may need the override anyway.

Just my 2 cents

Jörgen @ Kreativ Fotografi
Title: Re: How to add text/code to all produrcts at once?
Post by: Milbo on February 17, 2015, 16:59:28 PM
Quote from: Jörgen on February 17, 2015, 11:33:45 AM
But when You have over 1000 products there would be a lot of work adding an extra text string to each product.
Yeah if you setup your products without any structure. We use for all products a product pattern, so it is just one product, which need to be changed. The working with child works now very robust and stable.
Missing indeed is a button to assign an existing product to a parent, or maybe even with a bulk, or per category. So also endusers could easily use it for already existing products.
Title: Re: How to add text/code to all produrcts at once?
Post by: Jörgen on February 18, 2015, 09:01:45 AM
Hello Milbo
QuoteMissing indeed is a button to assign an existing product to a parent, or maybe even with a bulk, or per category. So also endusers could easily use it for already existing products.

This is what I mean :) Right now the solution that GJC proposed will be the right way to go. You can Always later apply these patterns, when the option is available.

regards

Jörgen @ Kreativ Fotografi