Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Need help excluding categories


artstyle

Recommended Posts

Hi,

I recently had someone add a feature to my site where a customer can see products such as oil paintings that I sell on a wall and select colours and furniture from a chart. The problem is that I also sell other items that do not need this feature such as mugs etc.

This is the code from product info file that makes the reviews, see painting on the wall, add to wishlist and add to cart buttons appear. Is there a way that I can add php if code so that the "see your painting on the wall button" appears only when viewing products from certain categories such as oil paintings and watercolours and not appear when viewing other items in categories such as mugs.

 

I appreciate any help.

 

Thank you in advance,

Alexandra

 

 

<?php

}

?>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

<tr>

<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">

<tr class="infoBoxContents">

<td><table border="0" width="100%" cellspacing="0" cellpadding="2">

<tr>

<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

<td class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS, tep_get_all_get_params()) . '">' . tep_image_button('button_reviews.gif', IMAGE_BUTTON_REVIEWS) . '</a>'; ?></td>

<td class="main" align="center"><a href="java script:void(0)" onClick="window.open('try_painting.php?img=<?php echo $product_info['products_image']?>', 'MyPopUp', 'width=975,height=800,toolbar=0,scrollbars=1,resize=1,screenX=200,screenY=200

,left=200,top=200')"><img src="http://www.mysite.com/catalog/includes/languages/<?php echo $language; ?>/images/buttons/button_try_painting.gif" alt="Try This Painting" border="0"></a></td>

<td align="center"><?php echo tep_image_submit('button_wishlist.gif', 'Add to Wishlist', 'name="wishlist" value="wishlist"'); ?></td>

<td class="main" align="right"><?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?></td>

<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

</tr>

</table></td>

</tr>

</table></td>

</tr>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

Link to comment
Share on other sites

Hide Categories & Products http://addons.oscommerce.com/info/5907

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

Hide Categories & Products http://addons.oscommerce.com/info/5907

Hi Sam,

Thanks for the link.

I just want to make sure this contribution will help with what I would like done. I don't want to hide categories in the index page. I want to be able to control when the try the painting on the wall button/feature is displayed in the product_info page. On the product_info page I would like categories such as oil paintings and watercolours to display the reviews, try painting on wall, wishlist and add to cart buttons/features but for categories like mugs to display all but the try painting on wall feature/button. Will this contribution do the trick for me?

 

Thanks again,

Alexandra

Link to comment
Share on other sites

..Will this contribution do the trick for me...

 

I doubt it by the sound of it. anyway you need no contribution to achieve what you want to do since the mod is quite specific to your site. the 'someone' who added the feature should be doing that for you in no time.

 

Ken

commercial support - unProtected channel, not to be confused with the forum with same name - open to everyone who need some professional help: either PM/email me, or go to my website (URL can be found in my profile).

over 20 years of computer programming experience.

Link to comment
Share on other sites

Hi Sam,

Thanks for the link.

I just want to make sure this contribution will help with what I would like done. I don't want to hide categories in the index page. I want to be able to control when the try the painting on the wall button/feature is displayed in the product_info page. On the product_info page I would like categories such as oil paintings and watercolours to display the reviews, try painting on wall, wishlist and add to cart buttons/features but for categories like mugs to display all but the try painting on wall feature/button. Will this contribution do the trick for me?

 

These requirements are very specific, so you could take some clues from that contrib, but you are going to have to right code to achieve your wishes.

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

Hi,

Thanks for the reply.

I think if someone has done something similar with for example the reviews button ie: including/excluding it depending on category that would help.

 

Yes, the person who did the work on my site can do it but I already paid enough and don't want to pay more unless I can't figure it out on my own, with the help of the members on this forum, of course.

 

Thanks again,

Alexandra

Link to comment
Share on other sites

Try going to www.w3schools.com and in the sql section look for the select command.

 

You need to add/expand the where clause so only certain categories are found...

 

Enjoy

Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile

 

Virus Threat Scanner

My Contributions

Basic install answers.

Click here for Contributions / Add Ons.

UK your site.

Site Move.

Basic design info.

 

For links mentioned in old answers that are no longer here follow this link Useful Threads.

 

If this post was useful, click the Like This button over there ======>>>>>.

Link to comment
Share on other sites

..the person who did the work on my site can do it but I already paid enough and don't want to pay more unless ...

if i were the person i would not charge for extra just adding this little bit thing as i'd have aleady known the site very well and it only takes less than 10 min. if you want to do it yourself, here is the hint: first you need to find the queries that return categoeries (this may be specific to your site) and then you add a where condition to tell the db/mysql to exclude those categories using something like: categories_id <> $excluded_id where $excluded_id could be a number which is the id of the category to exclude. if you have more than one to exclude then just repeat it using AND.

 

Ken

commercial support - unProtected channel, not to be confused with the forum with same name - open to everyone who need some professional help: either PM/email me, or go to my website (URL can be found in my profile).

over 20 years of computer programming experience.

Link to comment
Share on other sites

Hi,

Thanks again for the hints.

I'm checking to see where I would put a select / exclude code. I have a try_painting.php file. It has these lines

 

require('includes/application_top.php');

require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PRODUCT_INFO);

 

$sql1 = mysql_query("SELECT * FROM colors LIMIT 1");

$res1 = mysql_fetch_assoc($sql1);

$dcolor = $res1['color'];

 

In catalog/includes/boxes/categories.php I have

 

$categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '0' and c.categories_id = cd.categories_id and cd.language_id='" . (int)$languages_id ."' order by sort_order, cd.categories_name");

while ($categories = tep_db_fetch_array($categories_query)) {

$tree[$categories['categories_id']] = array('name' => $categories['categories_name'],

'parent' => $categories['parent_id'],

'level' => 0,

'path' => $categories['categories_id'],

'next_id' => false)

 

Could you give me an example if you wanted the reviews button to appear in product_info page for category '1' but to exclude category '2'. Which files would you edit? The reviews.php file, the product_info.php or the /includes/boxes/categories.php file. Do you do anything in the phpMyadmin or is editing the file(s) enough? I think if I can see how it can be done for the reviews I can adjust it to the file I would like edited.

 

Thanks again for your help,

Alexandra

Link to comment
Share on other sites

...I have a try_painting.php file.
no other osc shop would have this file;

 

In catalog/includes/boxes/categories.php
irrelevant to what you want to do.
Could you give me an example if you wanted the reviews button to appear in product_info page...
i am afraid, no as your site has been heavily modified. review button on product info page would shown by default unless its been removed.

 

Ken

commercial support - unProtected channel, not to be confused with the forum with same name - open to everyone who need some professional help: either PM/email me, or go to my website (URL can be found in my profile).

over 20 years of computer programming experience.

Link to comment
Share on other sites

...I have a try_painting.php file

no other osc shop would have this file;

 

Yes, I know that. That's why I asked about the reviews button.

I found a contribution that plays around with the reviews button/function so I'll see if I can use that to help me.

 

If anyone has any tips or hints I appreciate any help.

 

Thank you,

Alexandra

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...