Jump to content
Sign in to follow this  
snakerboy

Products Properties v1.0

Recommended Posts

Im having a few problems, Ive got the mod installed ok but I cant seem to get any Properties to display.

 

Another thing is that the products_properties.php is split into 3 sections, on the bottom in the "Product Attribute" section, The product name dropdown shows a list of Categories rarther than Products. I find this a bit odd, why would I want to assign a property to a whole Category? either im going nuts or there is somthing im not seeing.

 

The contribution can be found here.... http://www.oscommerce.com/community/contri...arch,Properties

 

Thanks

Share this post


Link to post
Share on other sites

snakerboy

 

The product name dropdown shows a list of Categories rarther than Products.

This is because you will have to define first the properties for a specified categoy not for a product. This makes it easier to keep the overview of your product properties. So you define the properties for a category and only for this category.

For example:

 

Ram: RAM 256 MB for category RAM

this property is not needed for example for products in the category for harddrives. It only shows up for the RAM category.

 

If you will take a look in the products edit page (categories.php) when you edit a product you will see a button Products Properties. Click in the popup there will be only show up the defines for this category to select for your product.

 

I know there is a bug in this mod but i do not found the time to fix this the last weeks so i spend some time today to fix this problem and have written this mod completely new.

 

I find this a bit odd, why would I want to assign a property to a whole Category? either im going nuts or there is somthing im not seeing.

See above that's why you have to assign properties to a whole category!

 

 

 

The new version will be uploaded in a few hours

 

Joe

Share this post


Link to post
Share on other sites
Anyone have this up and running??

 

Would like to see it in action before i implement it.

 

Sorry jkf007 i forgot to upload screenshots will do it later but its just simple to install and takes about 10 minutes...

Share this post


Link to post
Share on other sites

I just installed as instructed...on a clean OSCommerce and I am getting:

 

Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /usr/home/birdshop/public_html/store/admin/includes/filenames.php:58) in /usr/home/birdshop/public_html/store/admin/includes/functions/sessions.php on line 67

 

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /usr/home/birdshop/public_html/store/admin/includes/filenames.php:58) in /usr/home/birdshop/public_html/store/admin/includes/functions/sessions.php on line 67

 

from the admin screen.....what did I do wrong?

 

Thanks,

 

Dalmuti

Share this post


Link to post
Share on other sites

Hi noisebox,

 

I installed your contribution. It works great but I'm having 2 problems:

 

1- On the admin side, when properties are set for a certain category and I want to assign a value, the select-list for the values show all values, not just for that property.

I have addes 2 properties (Size and Color). When assigning them to a product the value name shows (L, M, S, Black, White), no matter what property I choose. The values and properties are not chained.

 

Can you fix this?

 

2- The Products Properties field is always shown in product_info.php. I've checked the code

<?php
$properties = "select options_id, options_values_id from " . TABLE_PRODUCTS_PROPERTIES . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' order by sort_order asc";
   $properties = tep_db_query($properties);
?>
<?php 
if(tep_not_null($properties)) { ?>
       <tr>
          <td class="main"><p><b><?php echo TEXT_PRODUCTS_PROPERTIES; ?></b></p></td>
       </tr>
<?php  
} 
?>

but it seems OK, but not working.

 

Can you help?

 

Thanks in advance.

Share this post


Link to post
Share on other sites

I've solved the second part. When using this code

<?php
$properties = "select options_id, options_values_id from " . TABLE_PRODUCTS_PROPERTIES . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' order by sort_order asc";
   $properties = tep_db_query($properties);
   $num_properties = tep_db_num_rows($properties);
?>
<?php 
if ($num_properties >= 1) { ?>

       <tr>
          <td class="main" colspan="2"><p><b><?php echo TEXT_PRODUCTS_PROPERTIES; ?></b></p></td>
       </tr>
<?php  
} 
?>

the header is not shown when there are no properties available.

Share this post


Link to post
Share on other sites

I just noticed that a new feature could be usefull.

 

It's not possible to add a custom value when adding properties to a product.

 

In case of languages for a product like a DVD-movie, it would be great to add custom values (like "English, French, Spanish" or "English, French") instead of choosing form predefined values.

 

Could this be implemented?

Share this post


Link to post
Share on other sites
the header is not shown when there are no properties available.

 

Thanks for your feedback. I will fix this in the next version. maybe today. I will think about your suggestion on having an extra field.

 

:rolleyes:

Share this post


Link to post
Share on other sites
I just installed as instructed...on a clean OSCommerce and I am getting:

 

Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /usr/home/birdshop/public_html/store/admin/includes/filenames.php:58) in /usr/home/birdshop/public_html/store/admin/includes/functions/sessions.php on line 67

 

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /usr/home/birdshop/public_html/store/admin/includes/filenames.php:58) in /usr/home/birdshop/public_html/store/admin/includes/functions/sessions.php on line 67

 

from the admin screen.....what did I do wrong?

 

Thanks,

 

Dalmuti

 

Dalmuti,

 

could you please check your complete installation again, i think it should work because there are not probs. by other users....

Share this post


Link to post
Share on other sites
1- On the admin side, when properties are set for a certain category and I want to assign a value, the select-list for the values show all values, not just for that property.

I have addes 2 properties (Size and Color). When assigning them to a product the value name shows (L, M, S, Black, White), no matter what property I choose. The values and properties are not chained.

 

 

hopfully i will take a look at it next week to change this by onSubmit script - for now i do not have too much time so give me so more time....

Share this post


Link to post
Share on other sites
I just noticed that a new feature could be usefull.

 

It's not possible to add a custom value when adding properties to a product.

 

In case of languages for a product like a DVD-movie, it would be great to add custom values (like "English, French, Spanish" or "English, French") instead of choosing form predefined values.

 

Could this be implemented?

hi OKAa

Adding such a custom value is what the PEF contribution does, though it works language independent ...

 

All,

Could anyone explain how product properties is different from the static attributes contribution ?

To me it looks like 2 different implementations of essentially the same thing (readonly options), also if you have option types installed plus static attributes you can have multiple values (think of it as readonly/static checkboxes)


KEEP CALM AND CARRY ON

I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support).

So if you are still here ? What are you waiting for ?!

 

Find the most frequent unique errors to fix:

grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt

Share this post


Link to post
Share on other sites
Could anyone explain how product properties is different from the static attributes contribution ?

Hi bruyndoncx

i do not really know what the static attributes does caused by "never installed". BTM ProductsProperties is a tool to quicker and less stressfull adding Properties to Products like:

 

RAM - 256 MB

Harddrive - 7200 rpm/min

.

.

.

 

This fearture is nothing you can add into your shopping cart so it is meant to show up the products properties.

A lot of users browsing through shops and could not decide which product they should choose. This is caused by the users laziness. A lot of surfers do not want to read through many descriptions to find what they are searching for. Imagine the people who haven't much knowledge about for example computers or technical stuff but do also know if somebody is talking about pentium 4 3GHz or RAM 512 MB.

 

 

 

 

At the moment this feature look like two different impl. as you can see but will be shortly merged in a better way into the products listing in categories.php.

Share this post


Link to post
Share on other sites

Hi Noisebox,

 

Thanks for the update, but one thing I cant't find:

 

In the instructions it says:

in the same file find:

 

<td class="dataTableContent" align="right"><?php if ($products['products_id'] == $products_properties_id) { echo '<a href="java script:popupPropertiesWindow(\'' . tep_href_link(FILENAME_PRODUCTS_PROPERTIES_POPUP, 'cID=' . $current_category_id . '&pID=' . $products['products_id']) . '\')">

 

and right before add:

 

<?php 

$products_properties_query = tep_db_query("select products_id from " . TABLE_PRODUCTS_PROPERTIES . " where products_id = '" . (int)$products['products_id'] . "'");

  while($products_properties = tep_db_fetch_array($products_properties_query)) {

  $products_properties_id = $products_properties['products_id'];

  }

?>

But I can't find this in admin/categories.php.

 

Is there something missing??

Share this post


Link to post
Share on other sites

OKA

 

Try to find: (this is from the orignal categories.php)

 

<td class="dataTableContent" align="right"><?php if (isset($pInfo) && is_object($pInfo) && ($products['products_id'] == $pInfo->products_id)) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?> </td>

 

 

 

 

 

and add this before it:

<?php

$products_properties_query = tep_db_query("select products_id from " . TABLE_PRODUCTS_PROPERTIES . " where products_id = '" . (int)$products['products_id'] . "'");

while($products_properties = tep_db_fetch_array($products_properties_query)) {

$products_properties_id = $products_properties['products_id'];

}

?>

 

 

 

That should do it.

Share this post


Link to post
Share on other sites

@ all

 

i will be back on monday - maybe i will take a look here at the weekend ;-) but can't promise.

 

 

so long Joe

Share this post


Link to post
Share on other sites

Cool I got stuck there too, I'll have a go in a moment.

 

:huh: If I get this installed then I'll be able to find out what this does... How about a nice description in the contributions section rather than just the message saying where not to download it. ;)


Steve.

 

Quick tip: Don't quote a fixed price for a variable project!

Share this post


Link to post
Share on other sites

I'm just installing away, am I being dense or does java script:popupPropertiesWindow() need to be defined somewhere?

 

And couple of broken images while I notice them:

 

In admin/categories.php.txt:

 

'test.gif', IMAGE_PROPERTIES_POPUP_ADD_CHANGE_DELETE

should read

'icon_properties_add_change.gif', IMAGE_PROPERTIES_POPUP_ADD_CHANGE_DELETE

 

and:

'test1.gif', IMAGE_PROPERTIES_POPUP_ADD

should read

'icon_properties_add.gif', IMAGE_PROPERTIES_POPUP_ADD


Steve.

 

Quick tip: Don't quote a fixed price for a variable project!

Share this post


Link to post
Share on other sites

For some reason i cannot pick the properties in the popup menu?

Nor can i specify the properties to a category?

 

Somethings wrong, the old 1.00 worked fine.. :unsure:


//Maz

Share this post


Link to post
Share on other sites
hi, i am unable to insert links in the properties. For e.g. if i insert <a href="http://www.xx.xom">jdssj</a>, everything within the quotes get deleted.

 

Please help.

 

 

bookseller

Step 1.

search for:

$value_name['products_options_values_name']

 

and change it to:

htmlspecialchars($value_name['products_options_values_name'])

 

 

Step 2.

search for:

case 'add_product_option_values':

$value_name_array = $_POST['value_name'];

 

and change line to:

case 'add_product_option_values':

$value_name_array = htmlspecialchars($_POST['value_name'], ENT_QUOTES);

 

 

That should work for the moment.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×