Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

category ID


freddyboy377

Recommended Posts

SOMEONE PLEASE HELP I DON'T SEE IT.

 

 

    // Add products you wish to exclude to this list.

    // Go to Admin->Catalog->Categories/Products->[Your category]

    // and look at the left hand side of the list to determine 

    // product id.   Note that 99999 and 99998 are just given

    // as examples.

    function exclude_product($id) {

        switch($id) {

           case 99999:

           case 99998:

                return true;

post-328497-0-95118300-1428467733_thumb.jpg

Link to comment
Share on other sites

Can you explain what you are trying to do?

Are you just trying to get the product ids or the category ids your image says category ids, but your post says product IDs

 

in your Admin->Catalog->Categories/Products

you need to click right down to the specific product and click edit on the product

now look in your address bar you will see a path like
(you may need to click in the address bar to show the full URL with the query string)

you will get something like this

yoursite/admin/categories.php?cPath=1_5&pID=27&action=new_product

the query string

cPath=1_5&pID=27

 

cPath=1_5 the categories are listed in descending order in this example category 1 is Hardware and category 5 is Keyboards (a subcategory of category 5)

pid = productID = 27

Link to comment
Share on other sites

Trying to do this: http://addons.oscommerce.com/info/6751

 

Trying to exclude an entire category from being discounted or a particular product, either way I believe would accomplish my goal.

 

    // Add products you wish to exclude to this list.
    // Go to Admin->Catalog->Categories/Products->[Your category]
    // and look at the left hand side of the list to determine
    // product id.   Note that 99999 and 99998 are just given
    // as examples.
    function exclude_product($id) {
        switch($id) {
           case 99999:
           case 99998:
                return true;

 

Doing as per the comments in this php file are instructing to do. I cannot see what he is talking about, However, that said I do see how you are arriving to your solution by pulling from the address bar which is fine but why can't I see what the comment is suggesting?

Link to comment
Share on other sites

I don't know either, perhaps there has been a change in the layout of the categories page and it no longer shows the category id in the info window

 

It shouldn't be too hard to add the code to display it in

 

Ok to make the category id display in the info box to the right

 

edit your admin/categories.php file (I am using 2.3.4BS so your line number may be different)

 $contents[] = array('text' => '<br />' .  tep_info_image($cInfo->categories_image, $cInfo->categories_name, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT) . '<br />' . $cInfo->categories_image);

Replace with

$contents[] = array('text' => '<br />Category ID - '.$cInfo->categories_id .'<br />' .  tep_info_image($cInfo->categories_image, $cInfo->categories_name, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT) . '<br />' . $cInfo->categories_image);

Link to comment
Share on other sites

And for the Product ID

 

edit your admin/categories.php file (I am using 2.3.4BS so your line number may be different)

$contents[] = array('text' => '<br />' . tep_info_image($pInfo->products_image, $pInfo->products_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '<br />' . $pInfo->products_image);

replace with

$contents[] = array('text' => '<br />Product ID - '.$pInfo->products_id .'<br />' . tep_info_image($pInfo->products_image, $pInfo->products_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '<br />' . $pInfo->products_image);

It should appear in the right hand info box just above the product image

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...