Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Please HELP with Easy Specials !


Recommended Posts

I use Easy Specials and when I try to appy % discount, i receive this error:

 

An appropriate representation of the requested resource /admin/specials.php could not be found on this server.

 

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

 

Is the "%' not supported? And if not, how I apply discount in percents ?

 

Regards, Andrei.

Link to comment
Share on other sites

Hi,

 

can you post here the URL shown in the browser when this happens? This could be a problem caused by mod_rewrite. Are you sure it happens only when applying percentage discount? Do you mean overall or single row discount applying?

 

Let me know about all this.

 

 

Bye

Eugenio

Link to comment
Share on other sites

URL when this happens is:

 

https://www.mystore.com/admin/specials.php?action=update_all&product_name=&cPath=&manufacturer_id=&sort=product_id&sort_type=asc&flag=&discount=50%25&date=&x=62&y=9

 

That is when I try to apply a 50% discount to all products in catalog (3 so far, just for testing). I typed in 50% in the "Discount (Currency or %):" field and clicked "Apply Discount."

 

If I type in 50 without the percentage sign, the price of all items is set to $50.

Link to comment
Share on other sites

I checked the script and tested it: I cannot reproduce the error you get. In general the 404 error lets me think that it should be a problem caused by your server settings, for example mod_rewrite, or some page authorization script in your osCommerce. There are scripts that help manage access to admin pages, these could cause this kind of problem.

 

Next step should be allowing me direct access to your store. Let me know.

 

 

Eugenio

Link to comment
Share on other sites

I don't think I'll be able to let you have access to my store but I do have an idea. Maybe the script can be modified so that there are 2 radio buttons or just a drop down box where the user can select either "currency" or "percent" for the type of discount. Then only the number can be typed in the input field. Obviously there is a problem with passing the percent sign itself through the script.

Link to comment
Share on other sites

Let's try this. Go to line 157 in specials.php, or find the following line:

 

 if(preg_match("/^(.*)%$/", $discount))

 

and change it to

 

 if(preg_match("/^(.*)(%|p)$/", $discount))

 

now you are able to pass a percentual discount either with percent "%" or "p" character. So you can apply a percentual discount of 10% in the form "10%" or "10p".

 

 

Let me know.

 

Eugenio

Edited by eugeniobonifacio
Link to comment
Share on other sites

  • 1 year later...

Hi Eguenio!

Thanks for this contribution.

I have been testing it and fixed some coding errors. Still, there are bugs to fix:

 

When the prices are set back to discount:

the prices shown are the normal prices with a strike through and the normal price in red.

Since there are no discount, the prices should be shown the normal way.

 

Since my site is not live yet, I would be happy to pm you my "corrected" code.

 

Please notify me by mail

 

Sara

Link to comment
Share on other sites

Hi! I have found yet another bug:

 

 foreach($fields as $k => $v) {
 $set_fields[] = "$k = '$v'";    //	 PHP Fatal error:  [] operator not supported for strings
 $set_fields = implode(', ', $set_fields);
 tep_db_query("UPDATE " . TABLE_SPECIALS . " SET $set_fields WHERE products_id = '$product_id'");
}

 

Is there a fix, please?

 

Sara

Edited by Juto
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...