Jump to content
TENCENTS

Custom Product Builder

Recommended Posts

@ RS Designs

 

Once again the problem is the age of the last update, you'll get some errors on the page like an accented a "á" and so on because of this>>

-------------------

@ line 30 where there's a blank space before the <head> put
 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" <?php echo HTML_PARAMS; ?>>


@ line 33 you'll find
 

<meta http-equiv="Content-Language" content="he">
<meta http-equiv="Content-Type" content="text/html; charset=windows0255">


you need to change this to something like this....
 

<meta http-equiv="Content-Language" content="en">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">


So changing these sorts out any character issues because utf-8 is now the standard set for OsCommerce

then go to line 85 and find

 

<td width="100" align="right"><?php if ($InsertProducts[$pcount]!=""){echo $currencies->format(str_replace(chr(160),'',$InsertPrices[$pcount]),false);} ?></td>


Replace with this
 

<td width="100" align="right"><?php if ($InsertProducts[$pcount]!=""){echo $currencies->format(substr($InsertPrices[$pcount], 2), false);} ?></td>


------------------------

then go to line 98 and find

 

 

<td width="100" align="right"><?php if ($InsertProducts[$pcount]!=""){echo $currencies->format(str_replace(chr(160),'',$InsertPrices[$pcount]),false);} ?></td>

Replace with this

 

 

<td width="100" align="right"><?php if ($InsertProducts[$pcount]!=""){echo $currencies->format(substr($InsertPrices[$pcount], 2), false);} ?></td>

For some reason str_replace, preg_replace, trim, rtrim and everything else doesn't seem to work in this statement to get rid of the white space at the front of each string in the array. substr did the job though. Now there should be no space between the currency symbol and the values, meaning the $currencies->format will work properly without an error. 

 

Of course you could go the non code way and just put -

 

 

echo "$" . $InsertPrices[$pcount];

 

instead of the

 

 

echo $currencies->format(substr($InsertPrices[$pcount], 2), false);

 

line. But obviously you wouldn't be able to use it for more than one currency at a time.

 

Anyhow, hopefully this is understandable and this sorts the whole module out finally!!

Edited by Nefandous

The oblivious carry on regardless to their surrounding until they're forced to confront reality or regard oblivion....

Share this post


Link to post
Share on other sites

@@Nefandous

 

I forgot to thank you for fixing all the errors for me. Everything worked great on my store (version 2.3.3.4)

 

But I have run into another little error after updating to (2.3.4) and added some more add-ons.

 

I think I know what is causing the issue but don't know how to fix it. This is what is happening:

 

-Everything is working great the only issue is I get "internal server error" after I hit the update button on the dependences page (and only that page, all other update fine) and this is the link in browser:

 

..../catalog/admin/builder_dependences.php?action=update&page=&sort_by=&cID=&row_by_page=80&manufacturer=&d_manufacturer=

 

-Now after  looking at the code I am pretty sure the problem in my canada post sell online add-on because it change the manufacturers file a little.

 

Here is what it changed in the manufacturer file

 

Open admin/manufacturers.php

 

Find:

if ($manufacturers_image->parse() && $manufacturers_image->save()) {
tep_db_query("update " . TABLE_MANUFACTURERS . " set manufacturers_image = '" . tep_db_input($manufacturers_image->filename) . "' where manufacturers_id = '" . (int)$manufacturers_id . "'");
}

ADD AFTER:              

 // Canada Post OST Start
                $countries_id = $HTTP_POST_VARS['countries_id'];
tep_db_query("update " . TABLE_MANUFACTURERS . " set countries_id = '" . (int)$countries_id . "' where manufacturers_id = '" . (int)$manufacturers_id . "'");
                // Canada Post OST End

Find:

$manufacturers_query_raw = "select manufacturers_id, manufacturers_name, manufacturers_image, date_added, last_modified from " . TABLE_MANUFACTURERS . " order by manufacturers_name";

In the same line after 'last_modified' ADD:

, countries_id

Find The FIRST occurance of:

$contents[] = array('text' => '<br />' . TEXT_MANUFACTURERS_URL . $manufacturer_inputs_string);

ADD AFTER:

// Canada Post OST start
$contents[] = array('text' => '<br />' . tep_draw_pull_down_menu('countries_id', tep_get_countries('Select Country')));
// Canada Post OST End

Find the SECOND occurance of:

$contents[] = array('text' => '<br />' . TEXT_MANUFACTURERS_URL . $manufacturer_inputs_string);

ADD AFTER:

// Canada Post OST start
$contents[] = array('text' => '<br />' . tep_draw_pull_down_menu('countries_id', tep_get_countries('Select Country'), $mInfo->countries_id));
// Canada Post OST End 

Share this post


Link to post
Share on other sites

Just to add to all the fun I listed above ^

 

I just notice something else that is acting up. 

 

-After creating a custom product and hit "add to cart" I get another "Internal server error" with this link:

 

....../catalog/builder_main.php/action/add_products

 

-But if I go back to the main store the custom product has been built and is in my cart correctly.

 

Any ideas?

Share this post


Link to post
Share on other sites

This topic is quiet.... the general.pho in my install (2.3.4) is different that the install procedure in the notepad ( -_-)


Fixed, and I'm happy it didnt work... It would've gotten very messy! I was in the main/includes directry and not the admin/includes directry. :P Always check your directries!

Edited by Arju2011

Share this post


Link to post
Share on other sites

I do not believe this contribution ever worked please correct if I am wrong

 

It never worked properly !!

 

Regards

Joli

Edited by joli1811

To improve is to change; to be perfect is to change often.

 

Share this post


Link to post
Share on other sites

I do not believe this contribution ever worked please correct if I am wrong

 

It never worked properly !!

 

Regards

Joli

That would explain why my page is broken. :P

Edited by Arju2011

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

×