Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

AJAX Attribute Manager support


Guest

Recommended Posts

I do not understand then that you before get the error also in products_attributes.php? Or did I understand wrong.

The code in template_top should be:

<!-- AJAX Attribute Manager  -->
<?php 
	if ((basename($_SERVER["SCRIPT_NAME"]) == 'categories.php')) {
		require('attributeManager/includes/attributeManagerHeader.inc.php');
	}
?>
</head>
<?php
  if (basename($PHP_SELF) == 'categories.php' && isset($action) && $action == 'new_product') {
    echo '<body onload="goOnLoad();">';
  } else {
    echo '<body>';
  }
?>
<!-- AJAX Attribute Manager  end -->

It should only have an influence in categories.php not in product_attributes.php

Link to comment
Share on other sites

6 minutes ago, bkiani said:

@raiwa

 

I did

""  remove also the code in template_top.php and   products_attributes.php ""

I did not see any errors

Sorry, I do not understand, there is no attributes manager code in products_attributes.php

Link to comment
Share on other sites

Sorry I'm lost now. The only advice I can give is to check again the permissions for your admin directory and ajax attributes manager directory and maybe to contact your hosting.

It seems permissions do not allow to load required content from the ajax attributes manager directory inside your admin directory.

Link to comment
Share on other sites

In file  template_top
This code is written

 

<!-- AJAX Attribute Manager  -->
<?php
    if ((basename($_SERVER["SCRIPT_NAME"]) == FILENAME_CATEGORIES)) {
        require('attributeManager/includes/attributeManagerHeader.inc.php');
    }
?>
<!-- AJAX Attribute Manager  end -->

<!-- AJAX Attribute Manager  -->
<body onload="goOnLoad();">
<!-- AJAX Attribute Manager  end -->

Link to comment
Share on other sites

that's also ok, if it worked before there is no reason to have an influence,. In the newer version the code I posted is used.

Link to comment
Share on other sites

I still do not understand what products_attributes.php page has to do with this. Can you explain details please.

Link to comment
Share on other sites

1 hour ago, raiwa said:

I still do not understand what products_attributes.php page has to do with this. Can you explain details please.

this page

view this error

 

1136 - Column count doesn't match value count at row 1

insert into products_attributes values (null, '52', '6', '3', '0', '+')

 

Link to comment
Share on other sites

ok, that's not related to the other error, neither to attribute manager if you didn't change settings like to use sort order in attribute manager config.

I really can't give more advice. Please try what I suggested before: check the permissions, please.

Link to comment
Share on other sites

On ۱۳۹۶/۴/۲۶ ه‍.ش. at 7:09 PM, raiwa said:

Browsers cache depends on your browser, you can google for how to do it in your browser.

The admin sessions:

open your database in phpMyAdmin.

select table sessions

search for all rows beginning similar to: "language|s:7:"english";languages_id|s:1:"1";admin|a:2:"

delete all these rows

Hello @raiwa

deleted all rows table sessions

The problem was solved
Thank you

Link to comment
Share on other sites

  • 4 weeks later...

@raiwa

In a test shop with php 7.1.7 

No errors displayed on shop or admin side.

Once in stalled, had to go through and reset some settings to false because I didn't have the particular add on installed. but once done all's good.

I am not a professional webmaster or PHP coder by background or training but I will try to help as best I can.

I remember what it was like when I first started with osC. It can be overwhelming.

However, I strongly recommend considering hiring a professional for extensive site modifications, site cleaning, etc.

There are several good pros here on osCommerce. Look around, you'll figure out who they are.

Link to comment
Share on other sites

Hi @raiwa Rainer,

I come to post a fix but you solved here: https://www.oscommerce.com/forums/topic/195959-ajax-attribute-manager-support/?do=findComment&comment=1758539

And post a sql error:

Quote

1054 - Unknown column 'option_image' in 'field list'

select products_name, products_options_name as _option, products_attributes.options_id as _option_id, products_options_values_name as _value, option_image as _image, products_attributes.options_values_id as _value_id from products_description, products_attributes, products_options, products_options_values where products_attributes.products_id = products_description.products_id and products_attributes.products_id = '24' and products_attributes.options_id = products_options.products_options_id and products_attributes.options_values_id = products_options_values.products_options_values_id and products_description.language_id = 3 and products_options_values.language_id = 3 and products_options.products_options_track_stock = 1 and products_options.language_id = 3 order by products_attributes.options_id, products_attributes.options_values_id

[TEP STOP]

I look in admin/attributeManager/attributeManager.php and this select is for:

// Modified by RusNN
if (AM_USE_QT_PRO) {
  $products_id = tep_db_prepare_input($_GET['products_id']);
  
   if(!isset($_GET['target']) || 'currentProductStockValues' == $_GET['target']) {
	if(!isset($_GET['target'])) 
		echo '<div id="currentProductStockValues">';

// options images added by @raiwa   
    $q=tep_db_query($sql="select products_name, products_options_name as _option, products_attributes.options_id as _option_id, products_options_values_name as _value, option_image as _image, products_attributes.options_values_id as _value_id from ".
                  "products_description, products_attributes, products_options, products_options_values where ".
                  "products_attributes.products_id = products_description.products_id and ".
                  "products_attributes.products_id = '" . $products_id . "' and ".
                  "products_attributes.options_id = products_options.products_options_id and ".
                  "products_attributes.options_values_id = products_options_values.products_options_values_id and ".
                  "products_description.language_id = " . (int)$languages_id . " and ".
                  "products_options_values.language_id = " . (int)$languages_id . " and products_options.products_options_track_stock = 1 and ".
                  "products_options.language_id = " . (int)$languages_id . " order by products_attributes.options_id, products_attributes.options_values_id");
  if (tep_db_num_rows($q)>0) {
    $flag = true;
    
    while($list=tep_db_fetch_array($q)) {
      $options[$list[_option_id]][]=array($list[_value],$list[_value_id]);
      $option_names[$list[_option_id]]=$list[_option];
      $product_name=$list[products_name];
    }

I don't use yet QTPRO to enter in this if, and I don't have option_image in my BBDD

Thanks in advance :)

Gustavo

Edited by PiLLaO
Link to comment
Share on other sites

Hello Gustavo @PiLLaO,

Just checked and as Steve @altoid also reported there are some settings activated in admin/attributeManager/includes/classes/attributeManagerConfig.class.php which shouldn't be activated. Please check and set

         * QT Pro plugin
         */
        $this->add('AM_USE_QT_PRO', true);


to "false" and also all other add-on support you do not use. this should solve the problem

Anyway I'll have a deeper look as soon as possible and update the add-on with the settings switched off by default.

Gracias compañero y un saludo cordial

Rainer

Link to comment
Share on other sites

Hola Gustaco @PiLLaO,

Just uploaded the package with the fixes.

The query you posted needed the following update to work with QTPro but without IMage Options:

// options images added by @raiwa         
    $q=tep_db_query($sql="select products_name, products_options_name as _option, products_attributes.options_id as _option_id, products_options_values_name as _value, " . ((AM_USE_IMAGE)? 'option_image as _image, ' : '') . "products_attributes.options_values_id as _value_id from ".

 

Link to comment
Share on other sites

Hello, I was looking over the install instructions and for the optional product attributes sort order add on..

https://apps.oscommerce.com/2K0SB

looks like it was last updated there in 2012 which is pretty much pre bs and edge. So I'll presume the coding there would be outdated. 

Wondering if table definition code would be the only thing needing updated. TABLE_PRODUCTS_ATTRIBUTES example

 

I am not a professional webmaster or PHP coder by background or training but I will try to help as best I can.

I remember what it was like when I first started with osC. It can be overwhelming.

However, I strongly recommend considering hiring a professional for extensive site modifications, site cleaning, etc.

There are several good pros here on osCommerce. Look around, you'll figure out who they are.

Link to comment
Share on other sites

Hello Steve @altoid,

If I well remember, the sort order feature in AJAX Attributes Manager can be used stand alone. Just switch the setting to "true" and the install script will create the additional columns if needed. And you need to modify the attributes queries in product_info.php.

Only thing is that the sort order is not available in the standard attributes admin page.

Link to comment
Share on other sites

Hello, thanks for that info. Got it now.

With that so updated, the values are showing in product_info neatly now. 

As you add them in the ajax portion, they will show in order of how you add them it appears.  That's a plus.

Also, I find by making and copying a template, when applying that template to a new product, the values show well as well.

If a shop owner really needs to change the order, it is possible to do that manually withing the products_attributes table.

Suggestion on instructions for AM...

consider removing:

1) If you haven't installed the attribute sort order contrib then you should install that one first: http://addons.oscommerce.com/info/1822 

Maybe some explanation of what I observed above would help a new user.

Also, in the code to be replaced for this purpose I see 

$HTTP_GET_VARS

I believe that has been modified when going to edge.

Thanks

 

I am not a professional webmaster or PHP coder by background or training but I will try to help as best I can.

I remember what it was like when I first started with osC. It can be overwhelming.

However, I strongly recommend considering hiring a professional for extensive site modifications, site cleaning, etc.

There are several good pros here on osCommerce. Look around, you'll figure out who they are.

Link to comment
Share on other sites

4 hours ago, altoid said:

Suggestion on instructions for AM...

consider removing:

1) If you haven't installed the attribute sort order contrib then you should install that one first: http://addons.oscommerce.com/info/1822 

Maybe some explanation of what I observed above would help a new user.

Also, in the code to be replaced for this purpose I see 


$HTTP_GET_VARS

I believe that has been modified when going to edge.

Hello Steve @altoid,

Thanks for your feedback. I'll have a look and update the package as soon as possible.

rgds

Rainer

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 months later...
On 28/8/2017 at 7:40 PM, raiwa said:

Hello Steve @altoid,

Thanks for your feedback. I'll have a look and update the package as soon as possible.

rgds

Rainer

Attributes sort order and attributes weight must be removed from install instructions (fortunately) you saved me a lot of work :)

Link to comment
Share on other sites

  • 3 months later...

I just find that console shows this error:

Refused to set unsafe header "Accept-Charset"

from admin/attributeManager/javascript/requester.js:64

this.commInterface.setRequestHeader('Accept-Charset',e);

I looked on Google with no clarify results

Best Regards

Link to comment
Share on other sites

4 hours ago, PiLLaO said:

I just find that console shows this error:


Refused to set unsafe header "Accept-Charset"

from admin/attributeManager/javascript/requester.js:64


this.commInterface.setRequestHeader('Accept-Charset',e);

I looked on Google with no clarify results

Best Regards

Yes, that header's not allowed (probably a security risk) see https://dvcs.w3.org/hg/xhr/raw-file/tip/Overview.html#dom-xmlhttprequest-setrequestheader

but a browser will probably just ignore it.

Is anything not working?

Contact me for work on updating existing stores - whether to Phoenix or the new osC when it's released.

Looking for a payment or shipping module? Maybe I've already done it.

Working on generalising bespoke solutions for Quickbooks integration, Easify integration and pay4later (DEKO) integration at 2.3.x

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...