Jump to content

Recommended Posts

No, it doesn't. That is planned but I also meant to have an update at this point so I don't know when that will happen.

Share this post


Link to post
Share on other sites

Very nice contribution. Thank you!

But it doesn't solve a problem I was hoping to solve. And I can't figure out how to use it. Is there documentation? I will explain my problem first NOT using your contribution.

I completely understand Optons and Values and applying them to products. In fact I find it faster to do it right in the database rather than using OSC's Attributes screen. But when I add my Sizes in order:
  Teacup -4.000
  Teacup Plus -3.000
  Toy -2.000
  Toy Plus -1.000
  Small  (zero change to price)
  Small Plus +1.000
  etc.

OSCommerce displays them in random order in the drop-down, and they HAVE to be in the order I list.

I've tried adding them to the database table directly using SQL, in the proper order, but they still display randomly. I want them to display in order by products_attributes_id. They're not even in alpha order. (see image1)

So I was hoping this contribution would help me control the sequence, but I don't see how. Not sure how to use the Sort Sequence, but it might help.

I am able to add a new Attribute on your Attributes tab. That works. (Can't control the sequence though.)

On the Options tab, If I add 3 new options (on 3 lines) they get created as one new Option. I can edit/modify an Option name. When I try to delete it, I get an error dialog "OK Undefined". So I can't delete them. (see image2)

I can't figure out how to add Values on the Values tab. I have a "values placeholder"' and nothing else, and no way to select an Option or edit the value. (see image3)

Settings tab doesn't seem to do anything. (see image4)

When I select a Product e.g. on the Attributes tab, that choice doesn't populate anything to the other tabs ...

The install went fine. I DID have to replace the code in admin/includes/template_top.php because of the version of jquery, as I was having exactly the same result as the member who asked you about that, and that solved the problem.

Does it appear something is wrong in the install? Can you give me a hint on how to get started? Should the Options/Values already created be populating on the Values tab? (They aren't.)  Some images added that might help.

I appreciate any help you can give me! Thank you!

Share this post


Link to post
Share on other sites

@@robinwarren As mentioned previously, this isn't a completed addon. You can control the basic attributes in the attributes section and most, I think, of the options section works but the values and settings are nowhere near done.

 

Regarding the order of the attributes, that has always been an issue with attributes in oscommerce. MySQL doesn't guarantee the order data is returned in so it doesn't matter how you input them. They might be in order one time but not another. The way to fix that is to install one of the attribute sorting addons. The Attributes Manager has that built-in so it is the best choice since it also allows controlling them from the product edit page.

 

As far as using this is concerned, if you need values added then create those in the old attributes section, until this one is working. In the attributes tab of this addon, when you select a category that has products, those products will be listed. If you want to add an attributes to a product, or a number of products, fill in the items below the product (option, value,etc.). When the minimum number of required things have been selected, a save button will appear and you can click that to add the attribute. Or, when you select a product click on the Show in Use button to see the attributes assigned to that product. You can then edit any of those. 

 

I hope this helps.

Share this post


Link to post
Share on other sites
Am 6.5.2017 um 07:56 schrieb Gratian:

Question:

In my shop 2.3 Options and Values with no options to select ? What is wrong ?

Product listing by Show in use it is ok but I can't edit anything.

That's exactly my problem also. oscommerce Version 2.3.4. - options and values are not loaded / displayed.

Take a look at my screenshot.

easier_attrib_sshot.jpg

Share this post


Link to post
Share on other sites
vor 1 Stunde schrieb msmichel:

 

... and here is the solution !

There is a 'bad' code in include/functions/easier_attributes.php, for example in

function GetAttributeOptions($languages_id = 1) {

and

function GetAttributeValues($languages_id = 1) {

This code excludes other languages than id=1. I found '$languages_id = 1' six times in the this file (and complete code) and changed it for me to '$languages_id = 2'.

But normaly this should be dynamic.

Share this post


Link to post
Share on other sites
21 minutes ago, msmichel said:

... and here is the solution !

There is a 'bad' code in include/functions/easier_attributes.php, for example in

function GetAttributeOptions($languages_id = 1) {

and

function GetAttributeValues($languages_id = 1) {

This code excludes other languages than id=1. I found '$languages_id = 1' six times in the this file (and complete code) and changed it for me to '$languages_id = 2'.

But normaly this should be dynamic.

The correct solution to make it dynamic is to add the $languages_id parameter to the function call.

In: admin/easier_attributes_ajax.php

find:

                  $values  = GetAttributeValues();

and change to:

                  $values  = GetAttributeValues($languages_id);

this will overwrite the default id in the function.

Share this post


Link to post
Share on other sites

That's a problem fixed in the non-released version. There is also another problem that could prevent the delete options from working  correctly. In admin/easier_attributes_ajax_options.php find and remove the following (around line 20):

?> <pre> <?php
print_r($_POST);
?> </pre> <?php   

echo 'cnt '.count($_POST).'<br>';
        

 

Share this post


Link to post
Share on other sites
Posted (edited)

I can't remove any product option as their attributes

 

unreachable code after return statement

easier_attributes.php:182:2 ( dataArray[0] = 'delete_options'; )

Shows: "OK undefined"

Ups: didn't read the last post sorry!

Edited by sinopia

Share this post


Link to post
Share on other sites
On 9/29/2018 at 2:07 PM, Jack_mcs said:

That's a problem fixed in the non-released version. There is also another problem that could prevent the delete options from working  correctly. In admin/easier_attributes_ajax_options.php find and remove the following (around line 20):


?> <pre> <?php
print_r($_POST);
?> </pre> <?php   

echo 'cnt '.count($_POST).'<br>';
        

 

Even removing this, shows "OK [object Object]" but options keeps to exist.

Share this post


Link to post
Share on other sites

I would be surprised if it worked with php 7.2 without changes. Actually, 2.3.4 should not be able to run on it either since that is a old version of oscommerce. In any case, I don't have a test shop setup with this addon installed that I can run with 7.2 so I can't offer any help at this time.

Share this post


Link to post
Share on other sites

@sinopia

22 hours ago, sinopia said:

2.3.4 - PHP 7.2

When you say "2.3.4", do you mean the 'official release' of osCommerce, or the responsive Community Edition?

M


If you are running the "official" osC 2.3.4 or 2.3.4.1 download, your installation is obsolete! Get the latest community-supported responsive "Frozen" release here

Share this post


Link to post
Share on other sites
Posted (edited)

Sorry to answer now. @Jack_mcs I see. Just needed to remove old product options and their respective attributes linked to products.

@ArtcoInc let's say it's unofficial release (bought it at themeforest...).

Jack I'm using jquery-1.11.1.. can this be related to anything? Because at devtools it shows this line dataArray[0] = 'delete_options'; as "unreachable code after return statement"
also this:

 

Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience For more help http://xhr.spec.whatwg.org/

 

 

Edited by sinopia

Share this post


Link to post
Share on other sites
2 hours ago, sinopia said:

Jack I'm using jquery-1.11.1.. can this be related to anything? Because at devtools it shows this line dataArray[0] = 'delete_options'; as "unreachable code after return statement"
also this:

Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience For more help http://xhr.spec.whatwg.org/

The javascript command is valid but there may be some problem with versions or maybe a command to load it is missing. There's no way for me to know in a support thread since that kind of failure requires troubleshooting.

The deprecated message is definitely due to the php version being used.

You should contact thethemeforest to see if their code will work with php 7. If not, which is most likely, you will have other problems besides the one with this addon. You would be far better off to replace your version with the latest CE oscommerce version.

Share this post


Link to post
Share on other sites

Hi @Jack_mcs the osC version weren't but I've updated it manually since the owner/item got removed from themeforest. Probably that's the best thing to do.

But for now just needed to really clean a few old products options/attributes. That's only what I need to do. Probably best thing to do is to code something that would clean the product options as their respective linked attributes.

Share this post


Link to post
Share on other sites
2 hours ago, sinopia said:

Probably best thing to do is to code something that would clean the product options as their respective linked attributes.

There shouldn't be any reason for that. I just installed this addon a few days ago into  live shop that has hundreds of attributes and it worked fine. I've worked with thethemeforest templates before and they were not well coded, in my opinion. So, as mentioned, I think you will have other problems. Good luck.

Share this post


Link to post
Share on other sites
Posted (edited)

@sinopia

Just out of curiosity, which theme did you buy? I see 7 themes for osCommerce there, some of which haven't been updated in years!

As others have mentioned, *most* themes available for osCommerce are poorly written, including many hacks to the core code. This makes the themed code a 'fork' in the osCommerce line. As such, the community here can not offer support for any of these themed forks. We have no way of knowing what changes the theme made to the core code.

So, you will need to go to TheThemeForest for support (good luck!). Or, start over with the Community Edition of osCommerce (link in my signature below).

M

 

I just re-read your post stating that the owner/item has been removed from TheThemeForest.

Edited by ArtcoInc

If you are running the "official" osC 2.3.4 or 2.3.4.1 download, your installation is obsolete! Get the latest community-supported responsive "Frozen" release here

Share this post


Link to post
Share on other sites

Doesn't seem like the ajax portion of the add on is working for me. Is there any advice on how to troubleshoot why ajax doesn't work?

Share this post


Link to post
Share on other sites

@Rachael w.Why do you think ajax is not working? When you click on Easier Attributes in the left column is the category dropdown showing and, if so, is it populated?

What oscommerce and php versions are you using?

Share this post


Link to post
Share on other sites

The page loads but it loads like this. And clicking the links brings up a url like this admin/easier_attributes.php#tabs-1

 

I'm using a highly modified 2.3 I think. PHP 7.

Untitled-2.jpg

Share this post


Link to post
Share on other sites

It appears the jquery code is not being loaded, though I don't know why. There is the line below in the admin/easier_attributes.php file. You can try removing it to see if that makes a difference. 

<script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>

There is a change in the included files that is not in the instructions so the following change should be made. In admin/includes/template_top.php, find

<base href="<?php echo ($request_type == 'SSL') ? HTTPS_SERVER . DIR_WS_HTTPS_ADMIN : HTTP_SERVER . DIR_WS_ADMIN; ?>" />

Replace it with

<?php 
/****Begin Easier Attributes ****/
if ($PHP_SELF !== 'easier_attributes.php') { ?>
<base href="<?php echo ($request_type == 'SSL') ? HTTPS_SERVER . DIR_WS_HTTPS_ADMIN : HTTP_SERVER . DIR_WS_ADMIN; ?>" />
<?php 
} 
/****End Easier Attributes ****/
?>

Other than that and assuming you made the other file changes, I can't think of a reason for it not to work. I tried it here in a shop running php 7.2 and it ran fine.  I suppose it could be due to a conflict with some other code in your shop but that seems unlikely to me. I'm sorry I can't be of more help.

 

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

×