Jump to content

PHP + MySql Gurus Needed Desperately - Simple for you = impossible for me...


Recommended Posts

Squeaky Clean Products
Client needed additional fields added to the store during the registration & check out process.

What's been done so far is...


Authentication.tpl - code added to the very top underneath the last name and in the address section underneath the city. The purpose is so that if they select anything other than 'Other' - they have an agreement with a company that will ship to one of the 4 counties. However if they select 'Other' it'll give an warning message that says "We don't deliver to this county." However they can still register.

-
Anderson County
Greenville County
Pickens County
Spartanburg County
Other



classes/Adress.php

/** @var integer Country id */
public        $county;

protected    $fieldsRequired = array('..., 'county');

protected    $fieldsSize = array('..., 'county' => 64,...');

protected    $fieldsValidate = array(..., 'county' => 'isGenericName',...');

       $fields['county'] = intval($this->county);



tabs/AdminAddresses.php

                
'.$this->l('County:').'

       <input type="text" size="33" name="county" value="'.htmlentities($this->getFieldValue($obj, 'county'), ENT_COMPAT, 'UTF-8').'" /> *



tabs/PDF.php

/* Display address information */
$pdf->Cell($width, 10, Tools::iconv(‘utf-8’, self::encoding(), $invoice_address->county), 0, ‘L’); $pdf->Cell($width, 10, Tools::iconv(‘utf-8’, self::encoding(), $delivery_address->county), 0, ‘L’); $pdf->Ln(5);



Database: Under the PS Address Table, county added.
Here are the problems:
1. - When doing a test run, under the Back Office >> Customers >> Addresses section, when the user has entered the County information it is registering as '0' under the Address Admin Tab.
2. - Also under the Back Office >> Customers, when selecting the 'View' actions, the following error happens:

Fatal error: Call to undefined method Cart::getcustomercarts() in /home/.javert/squeakyclean/store.squeakycleanproducts.net/admin537/tabs/AdminCustomers.php on line 119


3. - When reviewing the Orders under Back Office >> Orders - the county isn't registering on this page under the address.
4. - Also under Back Office >> Orders - when trying to view the .pdf to verify that the county is registering on the pdf, the following error is produced:

Parse error: syntax error, unexpected T_STRING in /home/.javert/squeakyclean/store.squeakycleanproducts.net/classes/PDF.php on line 266


5. - And finally when they get to the shipping section, there's a yes/no radio button asking if it’s ok to replenish any of the squeaky clean products (can’t continue unless they answer).
6. Have a yes no /section to refer anyone which includes a contact email and phone number field (they can continue if they don’t answer).

PHEW! Ok, these are my issues and i know there's a genius or several among you - this just isn't something i'm as familiar with. I could really use your help, this is already seriously past due.

Thanks in advance.

9978_3KvP0AmkmWTQq0CrI6Gy_t

9979_DuNbUCpwph9oUfrUHmVH_t

9980_0Hn2muvNBcYVb7t6ZNdP_t

Link to comment
Share on other sites


3. - When reviewing the Orders under Back Office >> Orders - the county isn't registering on this page under the address.


You also need to edit the admin/tabs/AdminOrders.php file for this, at about Line 495 /* Display adresses : delivery & invoice */


$fields['county'] = intval($this->county);


Try changing intval to pSQL.


-
Anderson County
Greenville County
Pickens County
Spartanburg County
Other


There is something wrong with this, I dont know what it is but it doesnt look right to me.

As for the PDF invoices I wasnt able to modify that and make it display correctly.
Link to comment
Share on other sites

I will try to be more clear.

$fields[‘county’] = intval($this->county); 


is in the address.php file in classes folder.

when going to the admin/tabs/adminorders.php section? line 495 is literally /* Display adresses : delivery & invoice */

You need to edit after line 495 to change the admin orders page.
Link to comment
Share on other sites

ok i've gotten that to work, thanks for the help!

Now here's my issue, i need to add the following fields to the order-carrier.tpl and have it validate, any ideas how to make this work? every time i try to directly edit the order-carrier.tpl and order.php it produces a completely blank page with no error to notify me what i did wrong.

>
Restock

Can we replenish  any of your squeaky clean products?


<input type="radio" name="radio" id="Yes" value="Yes" />
Yes 
or 

<input type="radio" name="radio" id="No" value="No" />
No


Referral Program

Our referral program details.
Do you have someone you'd like to 
refer?


<input type="radio" name="radio" id="Yes2" value="Yes" />

Yes or
<input type="radio" name="radio" id="No2" value="No" />
No


</pre>
<table width="671" border="0" cellspacing="3">Please enter your referrals below. Name<input type="text" name="Name" id="Name" /></td>
Email<input type="text" name="Email" id="Email" /></td>
Phone<input type="text" name="Phone" id="Phone" /></td>
Name<input type="text" name="Name2" id="Name2" /></td>
Email<input type="text" name="Email2" id="Email2" /></td>
Phone<input type="text" name="Phone2" id="Phone2" /></td>
Name<input type="text" name="Name3" id="Name3" /></td>
Email<input type="text" name="Email3" id="Email3" /></td>
Phone<input type="text" name="Phone3" id="Phone3" /></td>
Name<input type="text" name="Name4" id="Name4" /></td>
Email<input type="text" name="Email4" id="Email4" /></td>
Phone<input type="text" name="Phone4" id="Phone4" /></td>
Name<input type="text" name="Name5" id="Name5" /></td>
Email<input type="text" name="Email5" id="Email5" /></td>
Phone<input type="text" name="Phone5" id="Phone5" /></td>
</table>
<br><p>

{l s='County'}

-
Anderson County
Greenville County
Pickens County
Spartanburg County
Other



Link to comment
Share on other sites

×
×
  • Create New...