Blank page = error log.. can't GUESS why you are getting a blank page.. post the results of the error log..
Printable View
Hello and thank you for your efforts.
There are a few items that I would like to change, the page returns to the view history in my account,
can we add an if else or something to the code below to send it to "success" after submission.
if (!isset($_GET['order_id']) || (isset($_GET['order_id']) && !is_numeric($_GET['order_id']))) {
zen_redirect(zen_href_link(FILENAME_ACCOUNT_HISTORY_INFO, '', 'SSL'));
}
if (isset($_GET['action']) && ($_GET['action'] == 'success')) {
Also:
Since the code you wrote is not used during success, the order_number will not show in success (i guess) without calling it from the database from within success?
P.S. my page was blank because I guess I have fat fingers and added an extra ' to the returns.php
1.) Disregard my previous posts for I did not test thoroughly with @DivaVocals updated version.
2.) I actually installed the new version but did not test it (jumped the gun), but when I did (without any alterations), I am getting the send button on the success page (I am getting the success page) and no email being sent.
Thank you that works great.
I hate to be a pain... but I'm sure it's too late!
Can you see any way to get the order_number to the success page?
I removed that code and it send me back to success.
The success page I thought always had the send button, I was going to look at that next.
I get the email just fine.
The button was to low I moved it up a few lines.
<fieldset>
<legend class="write"><?php echo ENTRY_REASON; ?></legend>
<label class="inputLabel" for="reason"><?php echo (($error == true && $entry_reason_error == true) ? ENTRY_REASON_TEXT . zen_image($template->get_template_dir(RETURN_WARNING_IMAGE, DIR_WS_TEMPLATE, $current_page_base,'images'). '/' . RETURN_WARNING_IMAGE, RETURN_WARNING_IMAGE_ALT, RETURN_WARNING_IMAGE_WIDTH, RETURN_WARNING_IMAGE_HEIGHT) : ENTRY_REASON_TEXT . zen_image($template->get_template_dir(RETURN_REQUIRED_IMAGE, DIR_WS_TEMPLATE, $current_page_base,'images'). '/' . RETURN_REQUIRED_IMAGE, RETURN_REQUIRED_IMAGE_ALT, RETURN_REQUIRED_IMAGE_WIDTH, RETURN_REQUIRED_IMAGE_HEIGHT)); ?></label>
<?php echo (($error == true && $entry_reason_error == true) ? zen_draw_textarea_field('reason', '30', '7', $reason, 'id="reason"') . ENTRY_REASON_TEXT_ERROR : zen_draw_textarea_field('reason', '30', '7', $reason, 'id="reason"')); ?>
</fieldset>
</div>
<div class="buttonRow forward"><?php echo zen_image_submit(BUTTON_IMAGE_SEND, BUTTON_SEND_ALT); ?></div>
<?php
}
?>
</form>
<br class="clearBoth" />
</div>
<div class="buttonRow back"><?php echo zen_back_link() . zen_image_button(BUTTON_IMAGE_BACK, BUTTON_BACK_ALT) . '</a>'; ?></div>
UPDATED
So this was pretty easy and it's a great function.
1.) lets create a button
1.A) /includes/languages/english/YOUR_TEMPLATE_NAME/button_names.php
add:
1.b) upload your buttonPHP Code:
define('BUTTON_RMA_REQUEST', 'button_rma_request.png'); <-- Name of your button
define('BUTTON_RMA_REQUEST_ALT', 'Request an RMA'); <-- You buttons ALT (alternative text)
/includes/templates/YOUR_TEMPLATE_NAME/buttons/english
2. lets add the button to the My Account > History > Order Info page
2.A) /includes/templates/YOUR_TEMPLATE_NAME/templates/tpl_account_history_info_default.php
I added my button at the end of the file right after the <br class="clearBoth" /> and closing </div>
3.) /includes/modules/pages/returns/header_php.phpPHP Code:
<div class="rmaRequestButton"><?php echo '<a href="' . zen_href_link(FILENAME_RETURNS, (isset($_GET['page']) ? 'page=' . $_GET['page'] . '&' : '') . 'order_id=' . $_GET['order_id'], 'SSL') . '">' . zen_image_button(BUTTON_RMA_REQUEST) . '</a>'; ?></div>
in the middle of the file find:
change to:PHP Code:
zen_redirect(zen_href_link(FILENAME_RETURNS, 'action=success'));
PHP Code:
zen_redirect(zen_href_link(FILENAME_RETURNS, 'action=success' . '&order_id=' . $order_number));
towards the bottom find:
right below that add:PHP Code:
$postcode = $check_customer->fields['entry_postcode'];
}
Now in /includes/templates/YOUR_TEMPLATE_NAME/templates/tpl_returns_default.phpPHP Code:
$customer_info_query = "SELECT customers_id
FROM " . TABLE_ORDERS . "
WHERE orders_id = :ordersID";
$customer_info_query = $db->bindVars($customer_info_query, ':ordersID', $_GET['order_id'], 'integer');
$customer_info = $db->Execute($customer_info_query);
$order_number = $_GET['order_id'];
find:
change to:PHP Code:
<div class="mainContent success"><?php echo TEXT_SUCCESS; ?></div>
Thats it, now your customers "Order Number" text field on the returns page will be pre-populated by the order_id from within the My Account > History > Order Info page & sent to the success pagePHP Code:
<div class="mainContent success"><?php echo TEXT_SUCCESS; ?><?php echo 'Your RMA# is: '; $order_number = $_GET['order_id']; echo $order_number;?></div>
Enjoy!