Jump to content
kymation

[Contribution] Products Specifications

Recommended Posts

Cool Jim ,thank you.

 

One more issue using 2.3.4.

 

I get the admin dashboard showing up in the edit product page in the admin

 

Screenshot attached

 

Here is the code which I think is for that section on admin/categories.php.

 

Have I installed your contribution incorrectly or is this something completely unrelated??


          // Products Specifications
          $sql_data_array = array('products_name' => tep_db_prepare_input($HTTP_POST_VARS['products_name'][$language_id]),
                                  'products_description' => addslashes( tep_db_prepare_input( $HTTP_POST_VARS['products_description'][$language_id] ) ),
                                  // Start Products Specifications
									                'products_tab_1' => tep_db_prepare_input ($_POST['products_tab_1'][$language_id]),
									                'products_tab_2' => tep_db_prepare_input ($_POST['products_tab_2'][$language_id]),
									                'products_tab_3' => tep_db_prepare_input ($_POST['products_tab_3'][$language_id]),
									                'products_tab_4' => tep_db_prepare_input ($_POST['products_tab_4'][$language_id]),
									                'products_tab_5' => tep_db_prepare_input ($_POST['products_tab_5'][$language_id]),
									                'products_tab_6' => tep_db_prepare_input ($_POST['products_tab_6'][$language_id]),
                                  // End Products Specifications
                                  'products_url' => tep_db_prepare_input($HTTP_POST_VARS['products_url'][$language_id]));

          if ($action == 'insert_product') {
            $insert_sql_data = array('products_id' => $products_id,
                                     'language_id' => $language_id);

and further down i have this
 

      } elseif ($HTTP_POST_VARS['copy_as'] == 'duplicate') {
            $product_query = tep_db_query("select products_quantity, products_model, products_image, products_price, products_date_available, products_weight, products_tax_class_id, manufacturers_id from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'");
            $product = tep_db_fetch_array($product_query);

            tep_db_query("insert into " . TABLE_PRODUCTS . " (products_quantity, products_model,products_image, products_price, products_date_added, products_date_available, products_weight, products_status, products_tax_class_id, manufacturers_id) values ('" . tep_db_input($product['products_quantity']) . "', '" . tep_db_input($product['products_model']) . "', '" . tep_db_input($product['products_image']) . "', '" . tep_db_input($product['products_price']) . "',  now(), " . (empty($product['products_date_available']) ? "null" : "'" . tep_db_input($product['products_date_available']) . "'") . ", '" . tep_db_input($product['products_weight']) . "', '0', '" . (int)$product['products_tax_class_id'] . "', '" . (int)$product['manufacturers_id'] . "')");
            $dup_products_id = tep_db_insert_id();

	    // Products Specifications
            $description_query = tep_db_query("select language_id, 
			                                                       products_name,
                                                       products_description,
                                                       products_tab_1,
                                                       products_tab_2,
                                                       products_tab_3,
                                                       products_tab_4,
                                                       products_tab_5,
                                                       products_tab_6
                                              from " . TABLE_PRODUCTS_DESCRIPTION . "
                                              where products_id = '" . (int) $products_id . "'
                                            ");
            while ($description = tep_db_fetch_array($description_query)) {
// Products Specifications
              tep_db_query ("insert into " . TABLE_PRODUCTS_DESCRIPTION . " (
                products_id,
                language_id,
                products_name,
                products_description,
                products_tab_1,
                products_tab_2,
                products_tab_3,
                products_tab_4,
                products_tab_5,
                products_tab_6,
                products_viewed
              ) values (
                '" . (int) $dup_products_id . "',
                '" . (int) $description['language_id'] . "',
                '" . tep_db_input($description['products_name']) . "',
                '" . tep_db_input ($description['products_description']) . "',
                '" . tep_db_input ($description['products_tab_1']) . "',
                '" . tep_db_input ($description['products_tab_2']) . "',
                '" . tep_db_input ($description['products_tab_3']) . "',
                '" . tep_db_input ($description['products_tab_4']) . "',
                '" . tep_db_input ($description['products_tab_5']) . "',
                '" . tep_db_input ($description['products_tab_6']) . "',
                '0'
              )");
            }

            $product_images_query = tep_db_query("select image, htmlcontent, sort_order from " . TABLE_PRODUCTS_IMAGES . " where products_id = '" . (int)$products_id . "'");
            while ($product_images = tep_db_fetch_array($product_images_query)) {
              tep_db_query("insert into " . TABLE_PRODUCTS_IMAGES . " (products_id, image, htmlcontent, sort_order) values ('" . (int)$dup_products_id . "', '" . tep_db_input($product_images['image']) . "', '" . tep_db_input($product_images['htmlcontent']) . "', '" . tep_db_input($product_images['sort_order']) . "')");
            }

            tep_db_query("insert into " . TABLE_PRODUCTS_TO_CATEGORIES . " (products_id, categories_id) values ('" . (int)$dup_products_id . "', '" . (int)$categories_id . "')");
// Start Products Specifications
            $specifications_query = tep_db_query ("select specifications_id,
                                                          language_id,
                                                          specification
                                                   from " . TABLE_PRODUCTS_SPECIFICATIONS . "
                                                   where products_id = '" . (int)$products_id . "'
                                                 ");
            while ($specifications = tep_db_fetch_array ($specifications_query) ) {
              tep_db_query ("insert into " . TABLE_PRODUCTS_SPECIFICATIONS . " (
                                         products_id,
                                         specifications_id,
                                         language_id,
                                         specification) values (
                                         '" . (int) $dup_products_id . "',
                                         '" . (int) $specifications['specification_description_id'] . "',
                                         '" . (int)$specifications['language_id'] . "',
                                         '" . tep_db_input ($specifications['specification']) . "')
                           ");
            } // while ($specifications
// End Products Specifications
            $products_id = $dup_products_id;
          }

          if (USE_CACHE == 'true') {
            tep_reset_cache_block('categories');
            tep_reset_cache_block('also_purchased');

Share this post


Link to post
Share on other sites

Cool Jim ,thank you.

 

One more issue using 2.3.4.

 

I get the admin dashboard showing up in the edit product page in the admin

 

Screenshot attached

 

Here is the code which I think is for that section on admin/categories.php.

 

Have I installed your contribution incorrectly or is this something completely unrelated??


          // Products Specifications
          $sql_data_array = array('products_name' => tep_db_prepare_input($HTTP_POST_VARS['products_name'][$language_id]),
                                  'products_description' => addslashes( tep_db_prepare_input( $HTTP_POST_VARS['products_description'][$language_id] ) ),
                                  // Start Products Specifications
									                'products_tab_1' => tep_db_prepare_input ($_POST['products_tab_1'][$language_id]),
									                'products_tab_2' => tep_db_prepare_input ($_POST['products_tab_2'][$language_id]),
									                'products_tab_3' => tep_db_prepare_input ($_POST['products_tab_3'][$language_id]),
									                'products_tab_4' => tep_db_prepare_input ($_POST['products_tab_4'][$language_id]),
									                'products_tab_5' => tep_db_prepare_input ($_POST['products_tab_5'][$language_id]),
									                'products_tab_6' => tep_db_prepare_input ($_POST['products_tab_6'][$language_id]),
                                  // End Products Specifications
                                  'products_url' => tep_db_prepare_input($HTTP_POST_VARS['products_url'][$language_id]));

          if ($action == 'insert_product') {
            $insert_sql_data = array('products_id' => $products_id,
                                     'language_id' => $language_id);

and further down i have this
 

      } elseif ($HTTP_POST_VARS['copy_as'] == 'duplicate') {
            $product_query = tep_db_query("select products_quantity, products_model, products_image, products_price, products_date_available, products_weight, products_tax_class_id, manufacturers_id from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'");
            $product = tep_db_fetch_array($product_query);

            tep_db_query("insert into " . TABLE_PRODUCTS . " (products_quantity, products_model,products_image, products_price, products_date_added, products_date_available, products_weight, products_status, products_tax_class_id, manufacturers_id) values ('" . tep_db_input($product['products_quantity']) . "', '" . tep_db_input($product['products_model']) . "', '" . tep_db_input($product['products_image']) . "', '" . tep_db_input($product['products_price']) . "',  now(), " . (empty($product['products_date_available']) ? "null" : "'" . tep_db_input($product['products_date_available']) . "'") . ", '" . tep_db_input($product['products_weight']) . "', '0', '" . (int)$product['products_tax_class_id'] . "', '" . (int)$product['manufacturers_id'] . "')");
            $dup_products_id = tep_db_insert_id();

	    // Products Specifications
            $description_query = tep_db_query("select language_id, 
			                                                       products_name,
                                                       products_description,
                                                       products_tab_1,
                                                       products_tab_2,
                                                       products_tab_3,
                                                       products_tab_4,
                                                       products_tab_5,
                                                       products_tab_6
                                              from " . TABLE_PRODUCTS_DESCRIPTION . "
                                              where products_id = '" . (int) $products_id . "'
                                            ");
            while ($description = tep_db_fetch_array($description_query)) {
// Products Specifications
              tep_db_query ("insert into " . TABLE_PRODUCTS_DESCRIPTION . " (
                products_id,
                language_id,
                products_name,
                products_description,
                products_tab_1,
                products_tab_2,
                products_tab_3,
                products_tab_4,
                products_tab_5,
                products_tab_6,
                products_viewed
              ) values (
                '" . (int) $dup_products_id . "',
                '" . (int) $description['language_id'] . "',
                '" . tep_db_input($description['products_name']) . "',
                '" . tep_db_input ($description['products_description']) . "',
                '" . tep_db_input ($description['products_tab_1']) . "',
                '" . tep_db_input ($description['products_tab_2']) . "',
                '" . tep_db_input ($description['products_tab_3']) . "',
                '" . tep_db_input ($description['products_tab_4']) . "',
                '" . tep_db_input ($description['products_tab_5']) . "',
                '" . tep_db_input ($description['products_tab_6']) . "',
                '0'
              )");
            }

            $product_images_query = tep_db_query("select image, htmlcontent, sort_order from " . TABLE_PRODUCTS_IMAGES . " where products_id = '" . (int)$products_id . "'");
            while ($product_images = tep_db_fetch_array($product_images_query)) {
              tep_db_query("insert into " . TABLE_PRODUCTS_IMAGES . " (products_id, image, htmlcontent, sort_order) values ('" . (int)$dup_products_id . "', '" . tep_db_input($product_images['image']) . "', '" . tep_db_input($product_images['htmlcontent']) . "', '" . tep_db_input($product_images['sort_order']) . "')");
            }

            tep_db_query("insert into " . TABLE_PRODUCTS_TO_CATEGORIES . " (products_id, categories_id) values ('" . (int)$dup_products_id . "', '" . (int)$categories_id . "')");
// Start Products Specifications
            $specifications_query = tep_db_query ("select specifications_id,
                                                          language_id,
                                                          specification
                                                   from " . TABLE_PRODUCTS_SPECIFICATIONS . "
                                                   where products_id = '" . (int)$products_id . "'
                                                 ");
            while ($specifications = tep_db_fetch_array ($specifications_query) ) {
              tep_db_query ("insert into " . TABLE_PRODUCTS_SPECIFICATIONS . " (
                                         products_id,
                                         specifications_id,
                                         language_id,
                                         specification) values (
                                         '" . (int) $dup_products_id . "',
                                         '" . (int) $specifications['specification_description_id'] . "',
                                         '" . (int)$specifications['language_id'] . "',
                                         '" . tep_db_input ($specifications['specification']) . "')
                           ");
            } // while ($specifications
// End Products Specifications
            $products_id = $dup_products_id;
          }

          if (USE_CACHE == 'true') {
            tep_reset_cache_block('categories');
            tep_reset_cache_block('also_purchased');

post-264508-0-51914800-1406560495_thumb.jpg

Share this post


Link to post
Share on other sites

That's a jQuery bug. I believe that adding jQuery Migrate fixes it. If that doesn't work, let me know and I'll hunt down the old Javascript fix.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

Hello Jim,

 

i get the same issue as RMD27 in post #1055. adding jquery migrate in admin/template_top.php does not fix it for me. is there any other solution?

Share this post


Link to post
Share on other sites

jQuery Migrate fixes this problem. Check that you have added it after jQuery loads and before all other jQuery plugins load. Also check that the file exists and is being called correctly.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

I have changed my admin/includes/template_top.php so that jquery-migrate loads after jquery loads and it appears in debugger in firefox element inspector but the bug is still not fixed. I really need this addon for my shop. do you have any ideas why its not working correctly?

Share this post


Link to post
Share on other sites

You can try adding this Javascript code at the bottom of the head section in your admin template_top.php:

 

 

<script type="text/javascript">
// fix jQuery base tag bug
  $.fn.__tabs = $.fn.tabs;
  $.fn.tabs = function (a, b, c, d, e, f) {
    var base = location.href.replace(/#.*$/, '');
    $('ul>li>a[href^="#"]', this).each(function () {
      var href = $(this).attr('href');
      $(this).attr('href', base + href);
    });
    $(this).__tabs(a, b, c, d, e, f);
  };
</script>

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

Is there any way to fix the special characters bug? i have tried every solution in this topic and none of them work. how do i pass filters by id?

Share this post


Link to post
Share on other sites

got this installed but we have a very custom site and so not 100% sure the coding is perfect as had to shoehorn it into our existing code with STS also

 

anyways, i can add filters, specifications etc so we have added some linked to a single category for testing

http://www.outdoorbits.com/teleco-satellite-systems-c-570_514.html

 

however doesnt seem to work correctly so trying to identify if it is a coding issue or an incorrect setup somehow

 

We have set it so everything is displayed with minimum parameters of 0 so all filters display

 

My problem is firstly the filters box is duplicating specifications, see the filter picture below

secondly we have modified some products and allocated specifications/filters by editing the products and choosing relevant specifications on the specifications tab but the filters box doesn't seem to allow us to filter anyway, all the options say 15 or 0 (15 being the number of products in the category) see the dropdown picture below

 

Any help much appreciated

 

 

post-44538-0-83985100-1409394604_thumb.png

post-44538-0-95400600-1409394883_thumb.png

Share this post


Link to post
Share on other sites

have figured out the numbers being wrong as we had entered the filters incorrectly, we still have an issue whereby the titles arent being displayed above the filters and being replicated but i think this is a bug

Share this post


Link to post
Share on other sites

That filters box has some issues. You can try this version instead, or you can use some CSS to move things around.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

Hi, I am using oscommerce 2.3.4 for my store  I used Category Filters but I am pretty confused on using it -

Hence Planning to add this addon for the filtering purpose-

 

But I had a query
Does this addon provide a filter box on the side,
Show the current specifications product is related too
Along with multiple product filtering specifications on catalog side.

Awaiting an early response :)

Thank you in advance.....

Share this post


Link to post
Share on other sites

There is a filter box that you can put in either column, and there is one that you can put in the center of the page. Both are optional.

 

It can also show a list of specifications on the product page, or a table of specifications for all of the products in a category. Also optional.

 

I'm not sure if that answers all of yor questions, so ask again if you need more information.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

Thanks just one question before I go ahead with the install;
 

Is it working with 2.3.4 and

On admin side How is each specification assigned to the products...
As in Category filters I was suppose to choose a for each filter value a area from where it should be searched-

Like when I took Red as my filter value I did not have a option for choosing it as a productattribute- It gave options in Product Column like pd.products_description, p.products_price .... etc. which were of no use. Hence complete addon when to waste.

 

Sorry for questions but I need to check this very much as I need Colors, Price, Size, Casual, Formal as my main search criteria which are majorly related to my attributes for filtering

Awaiting your response.... :)

Edited by radhavallabh

Share this post


Link to post
Share on other sites

It will work with 2.3.4, but the included files are from a slightly older version, so you will have to patch some files by hand. There are not very many modified files, so this is not a huge job.

 

Specifications are linked to product categories, so you will have a specification to fill in for every product in that category.

 

Products Specifications does not handle Attributes/Options, so you may have to duplicate your attributes as Specifications if you want to use them as filters.

 

The User's Manual in the Addon package explains all of this in great detail. I recommend that you read it, then install PS on a test store and play with it.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

I have 'ask a question' module installed already so can i skip the one included in package

Edited by radhavallabh

Share this post


Link to post
Share on other sites

Hi, Cannot find these files in my catalog-

In Package as mentioned for modification-

catalog/ext/jquery/star_rating/jquery.rating.css
catalog/ext/jquery/star_rating/jquery.rating.pack.js

Edited by radhavallabh

Share this post


Link to post
Share on other sites

Hi Once again finally completely installed the addon-

Problems I am facing

The Product Specification Box on the right  for product filtering does not display.

I am trying to create a Color group

 So I created below for test-

Specifications Group: Dress Color

Specifications in Group: Color

Specifications Value: Red, Blue

 

Added it to a product and the whole layout broke-

Nothing displayed on the specifications tab... and columns misaligned

I have  Screenshot of admin configration and product info.

Please help....

(I need to show screenshots how to do so....) No option to upload

Share this post


Link to post
Share on other sites

In reference to above post:-

'

Hi Once again finally completely installed the addon-

Problems I am facing

The Product Specification Box on the right  for product filtering does not display.

I am trying to create a Color group

 So I created below for test-

Specifications Group: Dress Color

Specifications in Group: Color

Specifications Value: Red, Blue

 

Added it to a product and the whole layout broke-

Nothing displayed on the specifications tab... and columns misaligned

I have  Screenshot of admin configration and product info.

Please help....

(I need to show screenshots how to do so....) No option to upload'

 

 

The Filter box displays in grey with no specification showing- http://www.radhavallabh.com/radhakrishnastore/deity-dresses-c-25.html

The column layout broke on http://www.radhavallabh.com/radhakrishnastore/exotica-saree-wrap-devimata-dress-p-790.html

 

Please guide what has to be done.....

Share this post


Link to post
Share on other sites

There's a link to a new filters box a few posts up. Use that one instead of the one in the addon package.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

@@kymation

 

Hi, Did you mean this post-

 

That filters box has some issues. You can try this version instead, or you can use some CSS to move things around.

 

Regards

Jim

 

The link redirects me to this same page when I click on version.....

Edited by radhavallabh

Share this post


Link to post
Share on other sites

After updating the files-

Error on catalog side where the category is assigned with filter-

Fatal error: Call to a member function get_filter_data()on a non-object in ....../includes/modules/boxes/bm_products_filter.php on line 92

 

On index page showing Not enough filters though I have set Minimum filters to 1

Edited by radhavallabh

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

×