Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

EZier New Fields


nrlatsha

Recommended Posts

  • Replies 303
  • Created
  • Last Reply

Top Posters In This Topic

Sorry nrlatsha you contribution is great.

 

i am ms1

EZ v.2.1 (old verson of EZ)

 

I delete +0.0 and comma sign form prices,

it works OK for me

 

$list_price = ereg_replace(',' , '', $list_price);

$our_price = ereg_replace(',' , '', $our_price);

Link to comment
Share on other sites

I'm not sure why you're going through all the trouble to override the settings in TABLE_CURRENCIES with regards to decimal places, but here's a somewhat cleaner version of product_info output that looks like this:

 

Retail Price: $22.95

Your Price: $20.95

Sale Price: $18.95

You Save: $4.00 (17%)

 

Tested to work for all combinations of above (w/ and w/o Retail Price, w/ and w/o Sale Price). I've hard-coded the text "Sale Price" but you can easily enough add your own language definition for that if you need it.

 

// Begin EZier new fields contrib (Noel Latsha)
echo '<table border="0" cellspacing="0" cellpadding="1" CLASS="main">';
$min_Price = $product_info['products_price'];
$max_Price = $product_info['products_price'];
if ($product_info['products_retail_price']) { 
?$max_Price = $product_info['products_retail_price'];
?echo '<tr><TD><B>' . TEXT_PRODUCTS_RETAIL_PRICE_INFO . '  </td><td><s>' . $currencies->display_price($product_info['products_retail_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . '</s></td></tr>'; 
}
echo '<tr><TD><B>' . TEXT_PRODUCTS_PRICE_INFO . '  </td><td CLASS="productSpecialPrice">'; 
if ($special_price = tep_get_products_special_price($product_info['products_id'])) { ?
?$min_Price = $special_price;
?echo '<s>' . $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . '</s></td></tr>';
?echo '<tr><TD><B>Sale Price' . '  </td><td CLASS="productSpecialPrice">';
}
echo '<B>' . $currencies->display_price($min_Price, tep_get_tax_rate($product_info['products_tax_class_id'])) . '</b></td></tr>';
if ($max_Price > $min_Price) echo '<tr><TD><B>' . TEXT_PRODUCTS_SAVE_INFO . '  </td><td CLASS="productSpecialPrice">' . $currencies->display_price($max_Price - $min_Price,0) . " (" . round(100 - (($min_Price / $max_Price) * 100)) . '%)</td></tr>';
echo '</table>'; 
// End EZier new fields contrib (Noel Latsha)

Edited by oldmoney
Link to comment
Share on other sites

oldmoney - I knew there was a better way (I think I wrote that in the code) and this looks darnned good.

 

I'll take a look and include it in the next release, 4.0. I have more plans, including adding this to the whats new box, whats new page, search page and listing pages. If anyone can think of anything else, let me know...

 

I use the decimal places mod for sites like mine, when it comes to dollars and cents, the cents are pretty trivial.

 

Thanks for the code! Also very happy to hear the install went well. Some of the contribs I have re-written have been purely out of necessity for the contrib itself. So after spending hours figuring out what was wrong, I boxed it up and gave back to the community. I'm not a big fan of getting excited about a new contrib, only to have to use my backup files and going back to the before I started installing this point.

 

Once again, thank you.

 

Noel

9 times out of 10 its a PEBCAK Error (Problem exists between chair and keyboard)

 

Replace that and you're fine...

Link to comment
Share on other sites

installed the mod, worked perfect the first time just have a minor display problem i cant seem to find:

 

Retail Price: $49.99

Your Price: $29.99

You Save: 40% } ?>

 

you can see it highlighted in red. anyone know where i can find that?

Edited by CybrGost69
Link to comment
Share on other sites

catalog/product_info.php. Sounds like you'll be looking for an extra } ?> after a ?> at the end fo the contrib, or right after it.

9 times out of 10 its a PEBCAK Error (Problem exists between chair and keyboard)

 

Replace that and you're fine...

Link to comment
Share on other sites

I mistakenly put this question as a new topic...

 

I am trying to integrate EZier with Master Products.

 

If anyone here has done that, I would appreciate seeing what script changes you made to make it happen.

 

Right now, the Paster Product entry doesn't have the 'new field' of a sale/retail price set-up.

Rick Weiss

Link to comment
Share on other sites

Mind if I ask why we're adding this:

 

define('TEXT_PRODUCTS_RETAIL_PRICE', 'Products Retail Price:');

 

in catalog/admin/includes/languages/english/categories.php

 

when it already exists??? (b/c we added it earlier in Step 1)

 

define('ERROR_CANNOT_MOVE_CATEGORY_TO_PARENT', 'Error: Category cannot be moved into child category.');
define('TEXT_PRODUCTS_RETAIL_PRICE_INFO', 'Retail Price:');
define('TEXT_PRODUCTS_RETAIL_PRICE', 'Products Retail Price:');
?>

Edited by 420
Link to comment
Share on other sites

OK, a real issue ...

 

It changes existing values ...

 

299.99

332.98

 

to

 

299.9900

332.9889

 

... and also, why is the default 0 decimal place for retail price? Few people sell at exact dollar amounts and MSRP is never an exact dollar amount.

 

Also, strikethrough should be default for Retail field as it helps avoid confusion for the customer.

 

Those minor issues aside, great work and much appreciated. :)

Edited by 420
Link to comment
Share on other sites

420 - Funny you mention strikethrough, I thought of that the other day, same customer confusion reason too. I'll add that to the next version, which will be pretty large in comparison.

 

No decimals is default for my store, hence it is default for the contrib...

 

And yeah, it looks like you don't need to add that one field to admin lang file, I'll kill that on the next release too...

 

Anybody else have any suggestions?

 

rweiss - No, haven't played with master prods, don't really need it for my store. But if you get it working, let me know. I can also do this on the side, PM me if you're interested.

 

Noel

9 times out of 10 its a PEBCAK Error (Problem exists between chair and keyboard)

 

Replace that and you're fine...

Link to comment
Share on other sites

  • 2 weeks later...

just a little "template" problem, if i insert the retail price in admin for a products the catalag/product_info.php page it seams normal with the correct indication of the sale, but, if i don't insert the retail price the "structure" of this page is totally wrong, can you help me?

 

thank you

Link to comment
Share on other sites

i'm kinda confused.. how to add one statement to database.

 

1. add a table in product( database ) thru MySQLAdmin

ALTER TABLE `products` ADD `products_retail_price` decimal(10,2) default NULL AFTER `products_price`;

INSERT INTO configuration (configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('', 'EZier New Fields Decimal Places', 'NEW_FIELDS_DECIMAL', '0', 'Set the number of decimal places for your new fields', 1, 98, now(), now(), NULL, NULL);

2. in catalog/admin/includes/languages/english/categories.php add

  define('TEXT_PRODUCTS_RETAIL_PRICE_INFO', 'Retail Price:');
  define('TEXT_PRODUCTS_RETAIL_PRICE', 'Products Retail Price:');

 

 

Can you explain this statement?

I have no idea how to change datebase using mysqladmin

Link to comment
Share on other sites

I did finish the first part.

 

I'm stuck on 2nd.

 

INSERT INTO configuration (configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('', 'EZier New Fields Decimal Places', 'NEW_FIELDS_DECIMAL', '0', 'Set the number of decimal places for your new fields', 1, 98, now(), now(), NULL, NULL);

 

HOw can I insert into congifuration

Link to comment
Share on other sites

You'll need to do that through phpmyadmin. You'll probably find this in your webhost control panel.

9 times out of 10 its a PEBCAK Error (Problem exists between chair and keyboard)

 

Replace that and you're fine...

Link to comment
Share on other sites

just a little "template" problem, if i insert the retail price in admin for a products the catalag/product_info.php page it seams normal with the correct indication of the sale, but, if i don't insert the retail price the "structure" of this page is totally wrong, can you help me?

 

thank you

You'll have to play around with the tables then, do you have a link? Its probably the last else statement that needs removed or somthing, a link would help to see what happens though....

 

j0ker - Personally I haven't tried it myself, I don't have those installed, but you can install and post here if you have problems.

9 times out of 10 its a PEBCAK Error (Problem exists between chair and keyboard)

 

Replace that and you're fine...

Link to comment
Share on other sites

I'm thinking it should be good. I havent' really seen this clash with anything and I have 56 contribs installed myself, but no template systems...

9 times out of 10 its a PEBCAK Error (Problem exists between chair and keyboard)

 

Replace that and you're fine...

Link to comment
Share on other sites

Since you seem to be very clued on this osc, I have a question I have asked many forums no one answered yet.

 

Is it possible to run a html index page outside of the osc catalog folder pulling whats new and specials in to that index page so that the website front page can be a hig quality dynamic page?

Link to comment
Share on other sites

The third time I rebuilt my store, I started with BTS or STS, dont remember. But I thought about it after I installed and after seeing some people's stores here, with no template system, I figured I can do that too and not have to worry about the templates folder, different pages. Much like the problem you have, seems like all contribs are for a non template store, so you have to dissect each contrib to find out which folder it goes into.

 

So I started over again, but with no templates and started learning design and modifications as much as possible. Now I think its far from the default setup and hard to tell its OSC.

 

I think I remember you asking this question a couple of weeks ago, or someone else did. But I didn't have an answer.

 

I imagine you can (you can do anything, right? :D ) but I think the easiest way to go with this is with the mod_rewrite to turn your urls into .html extensions. I think you'll still need the php functions to call the database stuff (or .asp) within that static page. Of course if you have dynamic whats new and specials, then the page ceases to become static... ;)

 

So... In a nutshell, It probably can, but I can't give you a definate answer or point you in the right direction. Unless you use the mod_rewrite for apache.

 

Are you doing this for search engines? Or a splash page?

9 times out of 10 its a PEBCAK Error (Problem exists between chair and keyboard)

 

Replace that and you're fine...

Link to comment
Share on other sites

Thx very much for the time to reply to an off topic question.

 

When I sort out websites for people, the thing that I get asked to do most is a presentation page, this is not a problem but I would like to make this a bit dynamic and include specials as a pull for customers.

 

Example: I am sorting a site out for a friend who sells reptile products but he wants 2 sites 1 wholesale and 1 retail, he does not want a b2b/b2c site that can do both he wants 2 complete sites, so I have almost done a presentation front page with links to both, so customer have the choice. ;)

 

It was just something that was bugging me really as I had not had a reply, so I was getting the feeling it couldnt be done, but I like you seem to think anything can be done with the right mind. :blink:

 

This is the front page I am trying to include specials content into, plz ignore the mess I have a lot to do in the site yet:

 

http://www.elwynsbits.co.uk/eurorepfront

 

As you can see I have place holders 4 in centre, this may change to 2, these would ideally be products with descriptions maybe, I left it open really until I had time to look at it closer regarding the content from osc if it was possible.

 

But many thx for dangling the carrot, and answering my question as far as you could. :D

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...