Hello Seppo,
Very good suggestion. I'll add it in next version.
But quick solution for you. Open plugins/content/catproduct/catproduct.php
and find
if (strpos($working,'#CATEGORY[') !== false) {<br /> preg_match("/#CATEGORY.*?[(.*?)\]/",$working,$category_ids);
$category_ids = $category_ids[1];
} else $category_ids = '';
and replace it with
if (strpos($working,'#CATEGORY[') !== false) {<br /> preg_match("/#CATEGORY.*?[(.*?)\]/",$working,$category_ids);
$category_ids = $category_ids[1];
if (JRequest::getInt( 'virtuemart_category_id', 0) != 0) array_push($category_ids, JRequest::getInt( 'virtuemart_category_id', 0));
} else $category_ids = '';
So with that if you put
#CATEGORY[] inside catproduct contend command it will also search for category inside url.
Hope it helps.
Best Regards,
Maja
Very good suggestion. I'll add it in next version.
But quick solution for you. Open plugins/content/catproduct/catproduct.php
and find
if (strpos($working,'#CATEGORY[') !== false) {<br /> preg_match("/#CATEGORY.*?[(.*?)\]/",$working,$category_ids);
$category_ids = $category_ids[1];
} else $category_ids = '';
and replace it with
if (strpos($working,'#CATEGORY[') !== false) {<br /> preg_match("/#CATEGORY.*?[(.*?)\]/",$working,$category_ids);
$category_ids = $category_ids[1];
if (JRequest::getInt( 'virtuemart_category_id', 0) != 0) array_push($category_ids, JRequest::getInt( 'virtuemart_category_id', 0));
} else $category_ids = '';
So with that if you put
#CATEGORY[] inside catproduct contend command it will also search for category inside url.
Hope it helps.
Best Regards,
Maja
This is more a suggestion that a question:
Please modify your plugin, or make a new version in a way that it can be used to show all products in a category. While this is there already somehow in a way, it is not very flexible since you always need to write that category id manually:
If there is a menu for each virtuemart category (maybe automatically created instead of manually keeping it up), it would be good if, when one menuitem clicked, there would be a module or something with your Catproduct Content plugin showing all the products in that specific category. But that means that it needs to pick up category id automatically from GET or POST variable or such, instead of admin creating manually maybe hundreds of modules for hundreds of categories (and when there is usually no child products).
I believe that wasn't even a very large modification and would put usefulness of the plugin to whole new level :)
-Seppo