My Site - Zen Cart & WordPress integration specialist
I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.
Believe it or not, I do allot if searching and reading to "mainly" find easy and simple solution to incorporate into client websites to efficiently create the functions they require to successfully operate their e-commerce website.
Along the way, I add my two cents and if I think an idea or suggestion will enhance zen cart functionality for the vast majority, I will take the time to help make it work (where I can). Their are far more knowledgeable on this forum than I.
And thank you, it is good to hear a fellow contributor appreciate another.
Now stop stalking me, I mean watching. JUST KIDDING![]()
My Site - Zen Cart & WordPress integration specialist
I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.
Glad that you were able to use all my rough code and ideas and turn them into useful code for others to use.
I noticed a problem,
when it is set to allow logged-in users only it works fine.
When not logged in it will not show the order_id or customer_id in the email, and no customer_id in the success page.
Now in my case I take phone orders and I don't add that customer to zen cart. But if a phone customer wants to return
an item I send them to the RMA form. Of course they don't have a customer number.
So I changed the following line in tpl_returns_default.php
To:Code:'<div id="returnRMA">' . TEXT_SUCCESS_RMA_ID . $rma_number . '</div>'
And added:Code:'<div id="returnRMA">' . TEXT_SUCCESS_RMA_ID; $order_number = $_GET['order_id']; echo $order_number . TEXT_SUCCESS_DASH . $cID . TEXT_SUCCESS_DASH . date('mdY') . '</div>'
Just under this line:Code:<?php echo '<input type="hidden" name="cID" value="'.$cID.'">'; ?>
Code:<?php echo '<input type="hidden" name="rma_number" value="'.$rma_number.'">'; ?>
In: header_php.php I added
At the bottom of header_php.phpCode:// Prepare extra-info details // Admin email returned after submission $extra_info = email_collect_extra_info($name, $email_address, $customer_name, $customer_email, $telephone); // Prepare Text-only portion of message $text_message = OFFICE_FROM . "\t" . $name . "\n<br />" . OFFICE_EMAIL . "\t" . $email_address . "\n<br />" . "Phone Number:" . "\t" .$telephone . "\n<br />" . "Address:" . "\t" . $address . "\n<br />" . "City:" . "\t" . $city . "\n<br />" . "State:" . "\t" . $state . "\n<br />" . "Post Code:" . "\t" . $postcode . "\n<br />" . "Country:" . "\t" . $country . "\n<br />" . "Order Number:" . "\t" . $order_number . "\n<br />" . "Customer ID:" . "\t" . $cID . "\n<br />" . "Total Value:" . "\t" . $value . "\n<br />" . "Number of Items:" . "\t" . $item_number . "\n<br />" . "Item(s) Name:" . "\t" . $item_name . "\n<br />" . "Action Requested:" . "\t" . $action . "\n\n<br />" . "RMA Number:" . "\t" . $order_number . "-". $cID . "-". date('mdY') . "\n<br />" . '------------------------------------------------------<br />' . "\n\n<br />Reason:". "\n\n<br />" . "" . $reason . "\n\n<br />" . '------------------------------------------------------<br />' . "" . "\n<br />" . // Stop admin email // Begin customer email returned after submission $extra_info['TEXT']; $email_text = sprintf(EMAIL_GREET_NONE, $name ); $email_text .= "\n <br />"; $email_text .= EMAIL_WELCOME; $email_text .= "\n\n" . "Request Date:" . "\t" . date('m/d/Y') . "<br />" ; $email_text .= "\n" . "Customer ID:" . "\t" . $cID . "\n<br />"; $email_text .= "\n" . "Invoice Number:" . "\t" . $order_number . "<br />" ; $email_text .= "\n" . "Item(s)You Are Returning:" ."\n (as you entered it)" . "\t" . $item_name . "\n\n<br />"; $email_text .= "\n" . "RMA Number:" . "\t" . $order_number . "-". $cID . "-". date('mdY') . "\n<br />"; $email_text .= "\n\n" . EMAIL_TEXT . "<br />"; $email_text .= "\n" . EMAIL_CONTACT . "<br />"; $email_text .= "\n" . EMAIL_WARNING. "\n<br />";
I removed this line
and added this line in it's placeCode:$rma_number = $order_number . TEXT_SUCCESS_DASH . $cID . TEXT_SUCCESS_DASH . $rma_request_date;
it is just my idea of a work around, maybe you have something better?Code:$rma_number = $order_number . TEXT_SUCCESS_DASH . $rma_request_date;
Now when not logged in, the rma looks like this (2 dashes in center, missing customer_id)
Your RMA# is: 2425--04292013 and has the order_id in the email.
My Site - Zen Cart & WordPress integration specialist
I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.
My Site - Zen Cart & WordPress integration specialist
I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.
Sorry, this completely got overlooked over the weekend.
Here is the update.
in /includes/modules/pages/returns/header_php.php
find:
change to:PHP Code:"RMA Number:" . "\t" . $rma_number . "<br />" .
then find:PHP Code:"RMA Number:" . "\t" . $order_number . $rma_number . "<br />" .
change to:PHP Code:$rma_number = $order_number . TEXT_SUCCESS_DASH . $cID . TEXT_SUCCESS_DASH . $rma_request_date;
now in /includes/templates/YOUR_TEMPLATE/templates/tpl_returns_default.phpPHP Code:if($_SESSION['customer_id']) {
$rma_number = TEXT_SUCCESS_DASH . $cID . TEXT_SUCCESS_DASH . $rma_request_date;
} else {
$rma_number = TEXT_SUCCESS_DASH . $rma_request_date;
}
find:
change to:PHP Code:<div class="mainContent success">
<?php echo '<div id="returnSuccess">' . TEXT_SUCCESS . '</div>' . '<div id="returnRequired">'. TEXT_SUCCESS_RMA_REQUIRED . '</div>' . '<div id="returnPolicy">'. TEXT_SUCCESS_RMA_POLICY_BOF . '<a href="' . zen_href_link(FILENAME_SHIPPING, '', 'SSL') . '">' . TEXT_SUCCESS_RMA_POLICY_LINK . '</a>' . TEXT_SUCCESS_RMA_POLICY_EOF . '</div>' . '<div id="returnAddressWrapper">' . '<div id="returnRMA">' . TEXT_SUCCESS_RMA_ID . $rma_number . '</div>' . '<div id="returnAddress">' . TEXT_SUCCESS_RMA_RETURN_ADDRESS . '</div>'; if (RETURN_STORE_NAME_ADDRESS == 'true') { echo '<address>' . nl2br(STORE_NAME_ADDRESS) . '</address>'; } echo '<div id="returnPhone">' . TEXT_SUCCESS_RMA_RETURN_PHONE . '</div>' . '</div>'; ?>
Changes above are for the code in post #600PHP Code:<div class="mainContent success">
<?php
if($_SESSION['customer_id']) {
$order_number = $_GET['order_id'];
}
?>
<?php echo '<div id="returnSuccess">' . TEXT_SUCCESS . '</div>' . '<div id="returnRequired">'. TEXT_SUCCESS_RMA_REQUIRED . '</div>' . '<div id="returnPolicy">'. TEXT_SUCCESS_RMA_POLICY_BOF . '<a href="' . zen_href_link(FILENAME_SHIPPING, '', 'SSL') . '">' . TEXT_SUCCESS_RMA_POLICY_LINK . '</a>' . TEXT_SUCCESS_RMA_POLICY_EOF . '</div>' . '<div id="returnAddressWrapper">' . '<div id="returnRMA">' . TEXT_SUCCESS_RMA_ID . $order_number . $rma_number . '</div>' . '<div id="returnAddress">' . TEXT_SUCCESS_RMA_RETURN_ADDRESS . '</div>'; if (RETURN_STORE_NAME_ADDRESS == 'true') { echo '<address>' . nl2br(STORE_NAME_ADDRESS) . '</address>'; } echo '<div id="returnPhone">' . TEXT_SUCCESS_RMA_RETURN_PHONE . '</div>' . '</div>'; ?>
if a customer is logged in
RMA = order_number-customer_id-date on success page and email
if a return is requested without being logged in
RMA - order_number-date on success page and email
Last edited by rbarbour; 7 May 2013 at 11:04 AM. Reason: reason for edit
My Site - Zen Cart & WordPress integration specialist
I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.