Does this work with group pricing?
For example group a may access different categories than group b and so on.
I read thread but the only query in this regard was as u released v2.
Does this work with group pricing?
For example group a may access different categories than group b and so on.
I read thread but the only query in this regard was as u released v2.
If you are using SitemapXML along with this mod CSAR you will recognize that the categories and products are uploaded to the sitemap. I figured this would be the best place to post it instead of the SitemapXML support thread.
In includes/modules/pages/sitemapxml/ folder this is where the instructions to make the urls. So you will have to modify 2 of those files.
In sitemapxml_categories, find this line:
below it, add these lines:PHP Code:// EOF hideCategories
In sitemapxml_products, find this line:PHP Code:// bof exlude CSAR from sitemap
$category_login_block_query = explode(',',CATEGORY_RESTRICTION_LOGIN_CATEGORY); // block restricted categories - don't show in sitemap
foreach($category_login_block_query as $category_login_block) {
$from = '';
$where .= " and c.categories_id != '$category_login_block' ";
}
// bof exlude CSAR from sitemap
below it, add these lines:PHP Code:// EOF hideCategories
This is basically the same logic that the CSAR uses on the index filter php file. So now when uploading sitemaps it will exclude those categories and the products within from being posted.PHP Code:// bof exlude CSAR from sitemap
$category_login_block_query = explode(',',CATEGORY_RESTRICTION_LOGIN_CATEGORY); // block restricted products - don't show in sitemap
foreach($category_login_block_query as $category_login_block) {
$from = '';
$where .= " and p.master_categories_id != '$category_login_block' ";
}
// bof exlude CSAR from sitemap
Thanks for pointing this out yaritai. Didn't think about sitemaps when I wrote CSAR.
However, search engines would try to access the restricted products or categories and read the contents for indexing purposes. So, they would need to be 'logged in' which they can't do. If they run into blocks and are being redirected to the login page (as CSAR is designed to do) then those pages are not being indexed.
But - to prevent SE's getting 'annoyed' by redirections, your piece of code appears to be very useful.
I might consider including your suggestion in the next version of CSAR (have not tested it though...)
Thanks again
Cheers / Frank
Frank, also I do want to point out that in the tpl_product_info_display.php file you have a query to check for the master cat id. I will share a short version of it as zen has a function built in.
The current code:
can be swapped to just using:PHP Code:$products_id_to_block = $_GET['products_id'];
global $db;
$sql = "select master_categories_id from " . TABLE_PRODUCTS . " where products_id = :productID:";
$sql = $db->bindVars($sql, ':productID:', $products_id_to_block, 'integer');
$result = $db->Execute($sql);
This will give you the master id of the product being accessed. You can also get the category path instead of the master cat id with another stock function built in.PHP Code:$products_id_to_block = zen_get_products_category_id($_GET['products_id'])
I have just installed csar v2.0 in 1.5.3. When I go to my site, it is redirecting "Home" to the login page so that whoever visits the site is forced to login. Is there a way to change this? I have Configuration > Customer Details > Customer Shop Status - View Shop and Prices set to 0.
Good to hear that you have got this working.
Yes, that is one flaw with v2.0, at least one category needs to be defined as being restricted. That category can be a non-existing category (such as 20000).
I am working on an upgrade to eliminate this bug but time is rare atm to submit a tested and proven update.
Cheers / Frank
Hello Frank,
I'm migrating over from osCommerce - since Zen has included several addons I would have to manually add. I do very much like your CSAR, but I can't get it to work on the downloadable Documents in the stock install on zen 1.5.3. It works like a champ on categories, but Ducuments are all accessible either by category, ie 63 or product 171 or 63_171. Hopefully you can save me some time here.
Best,
Martin
OK, got it. These were linked products, so you have to include all their respective linked products, categories.. Neat stuff, Frank!