Simple Checkout - for 2.3.1 (official support thread)
#21
Posted 08 February 2012 - 02:30 PM
Let's start with defining MINIMUM_ORDER_NOTICE in your checkout.php language file and tell me what that definition is
#22
Posted 08 February 2012 - 02:40 PM
Change the second snippet of code to this. Also be sure to do the language define.
//Minimum quantity code if (data.msg != '') checkout.errMessage(data.status, data.msg); //Minimum quantity code
#23
Posted 08 February 2012 - 03:12 PM
Quote
Probably because define says:
define('MINIMUM_ORDER_NOTICE', "Minimum order amount for %s is %d. Your cart has been updated to reflect this.");
How can I define those variables at checkout? (%s is product name, and %d is the MOQ)
Edited by oxwivi, 08 February 2012 - 03:19 PM.
#24
Posted 08 February 2012 - 03:30 PM
#25
Posted 08 February 2012 - 05:53 PM
The modifications to the checkout.php fixed my field issues. Thank you so much. You rock!
There are some styling changes I would like to do, but I am not sure where in the code I need to look. Could you point me in the right direction?
For our customers I would like to add some text to the top of the dialog boxes, above password forgotten, click here etc...
I would also like to remove the newsletter check box (we don't have a newsletter).
And change the name of the button from confirm to sign in.
I assume the color and style of the dialog boxes are near the bottom under <style>. Is there a way to call our jquery theme into the styling of the dialog? I noticed when logged in the change address or new address pulls up a different looking box that goes with my theme.
Also I noticed that the checkout breadcrumb isn't showing up in the header bar. Not a big deal but something I noticed.
Thank you so much for all your hard work!
Category Description, CKEditor, Customer Sort, Enhanced Contact Us, Mindsparx Admin, Modular Front Page, Modular SEO Header Tags, Multiple Products Manager, Remove Unused Images, Select Product Image Directory, Shipping Cost Estimator, Simple Checkout for 2.3.1, Store Mode, Theme Switcher, UPSXML
#26
Posted 09 February 2012 - 08:53 AM
Delete button doesn't show confirm dialog, it would be a good idea to do this.
- would work in osc 2.2?
Regards!
#27
Posted 09 February 2012 - 02:36 PM
Delete button doesn't show confirm dialogI'm not sure where or what you are referring to. There are a few dialogs.
@oxwivi You may want to change the entire language. My server has been down for some time so I can't even get into mess with anything.
Right now you have:
$return['msg'] = sprintf(MINIMUM_ORDER_NOTICE, $min_order['products_name'], $min_order['minorder']);and
define('MINIMUM_ORDER_NOTICE', "Minimum order amount for %s is %d. Your cart has been updated to reflect this.");
Try doing this:$return['msg'] = MINIMUM_ORDER_NOTICE1 . $min_order['products_name'] . MINIMUM_ORDER_NOTICE2 . MINIMUM_ORDER_NOTICE3 . $min_order['minorder']and
define('MINIMUM_ORDER_NOTICE1', "Minimum order amount for ");
define('MINIMUM_ORDER_NOTICE2', " is ");
define('MINIMUM_ORDER_NOTICE3', ". Your cart has been updated to reflect this.");
I'm not sure if it's the sprint that's not being defined, or the data.msg that's not being defined. Could be the spring isn't passing through the ajax call.@varina
The dialog boxes are id'd as account and addresses. So search id="account" and id="addresses" without searching case sensitive. Those are your dialog divs (at the very bottom of the page). Add a new div directly inside those divs, containing the content you want and it will place it directly above the rest of the dialog.
Search the page for 'newsletter' and comment out the entire line that contains that field (I think there's only one line).
open the language/checkout.php file, search "confirm" and change it to what you want. Here's the problem though. As I stated, that button is stationary. It is the submit button for login, create account AND checkout as guest. Same button for all three. That's why I defined it as confirm (continue or submit are other options), rather than log in.
Search the checkout.php file for a line that contains something to the effect of $('.ui-dialog-.......).addClass('ui-state-highlight'); about 3/4 of the way down the page, and comment that line out. It will change the dialog to match your theme.
Edited by fulluvscents, 09 February 2012 - 02:38 PM.
#28
Posted 09 February 2012 - 04:30 PM
Regards!!
#29
Posted 09 February 2012 - 04:36 PM
#30
Posted 09 February 2012 - 05:24 PM
By the way, that wasn't quite language friendly. Not that I use anything other than English...
#31
Posted 09 February 2012 - 06:02 PM
- I removed $min_order['products_name'] and $min_order['minorder'] along with their references in languages file. Still undefined error.
- Removed all variables and done this: $return['msg'] = sprintf("Your cart has been updated, etc."); Still the same error.
#32
Posted 09 February 2012 - 07:40 PM
#33
Posted 10 February 2012 - 03:21 AM
I am using Paypal, and I need to change some code in the above file to make my product titles show up instead of my store name.
With the mod, checkout_confirmation.php is by passed.
I can't seem to find any code in your checkout.php that is similar to the parts I need to modify.
Here is what I need to do. It is pretty simple, but I am stumped.
2- Open catalog/checkout_confirmation.php
Find:
-----
require('includes/application_top.php');
Add after:
----------
$_SESSION['FixOrder'] = "";
Find: (Put the entire sentence because there are two equal sentences, the last)
-----
<?php
} else {
?>
<tr>
<td class="main" colspan="3"><?php echo '<b>' . HEADING_PRODUCTS . '</b> <a href="' . tep_href_link(FILENAME_SHOPPING_CART) . '"><span class="orderEdit">(' . TEXT_EDIT . ')</span></a>'; ?></td>
</tr>
<?php
}
for ($i=0, $n=sizeof($order->products); $i<$n; $i++) {
Add after:
----------
$_SESSION['FixOrder'] = $_SESSION['FixOrder'] . $order->products[$i]['name'] . " x " . $order->products[$i]['qty'] . " ";
Find:
-----
if ( (isset($order->products[$i]['attributes'])) && (sizeof($order->products[$i]['attributes']) > 0) ) {
for ($j=0, $n2=sizeof($order->products[$i]['attributes']); $j<$n2; $j++) {
echo '<br><nobr><small> <i> - ' . $order->products[$i]['attributes'][$j]['option'] . ': ' . $order->products[$i]['attributes'][$j]['value'] . '</i></small></nobr>';
}
}
Replace with this:
------------------
if ( (isset($order->products[$i]['attributes'])) && (sizeof($order->products[$i]['attributes']) > 0) ) {
for ($j=0, $n2=sizeof($order->products[$i]['attributes']); $j<$n2; $j++) {
echo '<br><nobr><small> <i> - ' . $order->products[$i]['attributes'][$j]['option'] . ': ' . $order->products[$i]['attributes'][$j]['value'] . '</i></small></nobr>';
$_SESSION['FixOrder'] = $_SESSION['FixOrder'] . "(". $order->products[$i]['attributes'][$j]['option'] . ': ' . $order->products[$i]['attributes'][$j]['value'] .")";
}
}
$_SESSION['FixOrder'] = $_SESSION['FixOrder'] ." | ";
Otherwise, everything is working great. We did a few test checkouts, and haven't encountered any issues.
On a funny note:
One time my hubby tried to edit and have a quantity of 2 for a product in the checkout (all of our items are unique, so that is not possible) and it threw him for a loop...he finally hit refresh and it took him back to the cart...silly men...
Anyways...hopefully my little problem isn't too hard to resolve.
-V
Category Description, CKEditor, Customer Sort, Enhanced Contact Us, Mindsparx Admin, Modular Front Page, Modular SEO Header Tags, Multiple Products Manager, Remove Unused Images, Select Product Image Directory, Shipping Cost Estimator, Simple Checkout for 2.3.1, Store Mode, Theme Switcher, UPSXML
#34
Posted 10 February 2012 - 02:23 PM
Quote
If you go to my account, view or edit address book entries, and add address (or edit address), it'll show the exact same thing. Wrote this to mimic the stock forms. I'm gonna look back into that language define in a bit. I'm a little baffled by it.
@PiLLaO
To add the confirm button:
Find:
cartDelete: function()
{
var row = $(this).parent();
$.ajax(
{
data: 'action=cartDelete&pID=' + $(this).attr('data-pID'),
success: function(data)
{
if (data.products == 0) {window.location = '<?php echo tep_href_link(FILENAME_SHOPPING_CART, '', 'SSL');?>';return false;}
else
{
row.remove();
checkout.headerShortcutsRefresh();
checkout.colsRefresh();
checkout.totalsRefresh();
checkout.RowsRefresh('payment');
if (data.shipping == 'false') $('#shipping').hide();
else {$('#shipping').show(); checkout.RowsRefresh('shipping');checkout.AddressRefresh('shipping');}
}
}
});
},
change to:
cartDelete: function()
{
if (confirm('<?php echo CONFIRM_DELETE ;?>'))
{
var row = $(this).parent();
$.ajax(
{
data: 'action=cartDelete&pID=' + $(this).attr('data-pID'),
success: function(data)
{
if (data.products == 0) {window.location = '<?php echo tep_href_link(FILENAME_SHOPPING_CART, '', 'SSL');?>';return false;}
else
{
row.remove();
checkout.headerShortcutsRefresh();
checkout.colsRefresh();
checkout.totalsRefresh();
checkout.RowsRefresh('payment');
if (data.shipping == 'false') $('#shipping').hide();
else {$('#shipping').show(); checkout.RowsRefresh('shipping');checkout.AddressRefresh('shipping');}
}
}
});
}
},
open the checkout.php language file, and add the definition:
define('CONFIRM_DELETE', 'Are you sure you want to remove this item?');
@varina
Here are your updated instructions. If they work, let me know and I'll add it as a compatibility feature.
2- Open catalog/checkout_confirmation.php
Find:
-----
require('includes/application_top.php');
Add after:
----------
$_SESSION['FixOrder'] = "";
Find: (Put the entire sentence because there are two equal sentences, the last)
-----
for ($i=0, $n=sizeof($products); $i<$n; $i++)
{
Add after:
----------
$_SESSION['FixOrder'] = $_SESSION['FixOrder'] . $products[$i]['name'] . " x " . $products[$i]['qty'] . " ";
Find:
-----
if (isset($products[$i]['attributes']) && is_array($products[$i]['attributes']))
while (list($option, $value) = each($products[$i]['attributes']))
{
echo tep_draw_hidden_field('attr[' . $products[$i]['id'] . '][' . $option . ']', $value);
$attributes = tep_db_query("select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa where pa.products_id = '" . (int)$products[$i]['id'] . "' and pa.options_id = '" . (int)$option . "' and pa.options_id = popt.products_options_id and pa.options_values_id = '" . (int)$value . "' and pa.options_values_id = poval.products_options_values_id and popt.language_id = '" . (int)$languages_id . "' and poval.language_id = '" . (int)$languages_id . "'");
$attributes_values = tep_db_fetch_array($attributes);
$productAttributes .= '<br /><small><i> - ' . $attributes_values['products_options_name'] . ' ' . $attributes_values['products_options_values_name'] . '</i></small>';
}
Replace with this:
------------------
if (isset($products[$i]['attributes']) && is_array($products[$i]['attributes']))
while (list($option, $value) = each($products[$i]['attributes']))
{
echo tep_draw_hidden_field('attr[' . $products[$i]['id'] . '][' . $option . ']', $value);
$attributes = tep_db_query("select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa where pa.products_id = '" . (int)$products[$i]['id'] . "' and pa.options_id = '" . (int)$option . "' and pa.options_id = popt.products_options_id and pa.options_values_id = '" . (int)$value . "' and pa.options_values_id = poval.products_options_values_id and popt.language_id = '" . (int)$languages_id . "' and poval.language_id = '" . (int)$languages_id . "'");
$attributes_values = tep_db_fetch_array($attributes);
$productAttributes .= '<br /><small><i> - ' . $attributes_values['products_options_name'] . ' ' . $attributes_values['products_options_values_name'] . '</i></small>';
$_SESSION['FixOrder'] = $_SESSION['FixOrder'] . "(". $attributes_values['products_options_name'] . ': ' . $attributes_values['products_options_values_name'] .")";
}
$_SESSION['FixOrder'] = $_SESSION['FixOrder'] ." | ";
Edited to change code for Varina.
Edited by fulluvscents, 10 February 2012 - 02:29 PM.
#35
Posted 10 February 2012 - 03:24 PM
Umm, yeah, so I made some changes to my file that you didn't have, and that's why it worked for me, and not you.
Download the newest changes and replace the checkout.php file (modified as needed).
Then, the codes that I've last given you should work correctly.
For recap:
find:
else {foreach($_POST['qty'] as $pID => $qty) $cart->update_quantity($pID, $qty, $_POST['attr'][$pID]);}
replace with:
//Minimum quantity code
// else {foreach($_POST['qty'] as $pID => $qty) $cart->update_quantity($pID, $qty, $_POST['attr'][$pID]);}
else
{
foreach($_POST['qty'] as $pID => $qty)
{
if(MINIMUM_ORDERS == 'true')
{
$min_order_query = tep_db_query("select minorder, products_name from " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id where p.products_id = '". $pID ."'");
while ($min_order = tep_db_fetch_array($min_order_query))
if ($qty < $min_order['minorder'])
{
$qty=$min_order['minorder'];
$return['msg'] = sprintf(MINIMUM_ORDER_NOTICE, $min_order['products_name'], $min_order['minorder']);
$return['status'] = 'warning';
}
}
$cart->update_quantity($pID, $qty, $_POST['attr'][$pID]);
}
}
//End Minimum quantity code
Find:
cartUpdate: function()
{
var pID = $(this).attr('data-pID');
$.ajax(
{
data: 'action=cartUpdate&' + decodeURIComponent($('#cartContent').find('[name^=qty[' + pID + ']], [name^=attr[' + pID + ']]').serialize()),
success: function(data)
{
if (data.products == 0) {window.location = '<?php echo tep_href_link(FILENAME_SHOPPING_CART, '', 'SSL');?>';return false;}
else
{
checkout.cartRefresh();
checkout.headerShortcutsRefresh();
checkout.colsRefresh();
checkout.totalsRefresh();
checkout.RowsRefresh('payment');
if (data.shipping == 'false') $('#shipping').hide();
else {$('#shipping').show(); checkout.RowsRefresh('shipping');checkout.AddressRefresh('shipping');}
}
}
});
},
Replace with:
cartUpdate: function()
{
var pID = $(this).attr('data-pID');
$.ajax(
{
data: 'action=cartUpdate&' + decodeURIComponent($('#cartContent').find('[name^=qty[' + pID + ']], [name^=attr[' + pID + ']]').serialize()),
success: function(data)
{
if (data.products == 0) {window.location = '<?php echo tep_href_link(FILENAME_SHOPPING_CART, '', 'SSL');?>';return false;}
else
{
checkout.cartRefresh();
checkout.headerShortcutsRefresh();
checkout.colsRefresh();
checkout.totalsRefresh();
checkout.RowsRefresh('payment');
if (data.shipping == 'false') $('#shipping').hide();
//Minimum quantity code
if (data.msg != '') checkout.errMessage(data.status, data.msg);
//Minimum quantity code
else {$('#shipping').show(); checkout.RowsRefresh('shipping');checkout.AddressRefresh('shipping');}
}
}
});
},
#36 ONLINE
Posted 10 February 2012 - 03:52 PM
I have not yet had time to test it, I will try to find the time over the weekend.
Or maybe a ready made theme for your shop ??
Warning: My posts may contain Horsemeat.
#38
Posted 10 February 2012 - 04:42 PM
I also uploaded a fix to the breadcrumb issue.
AAAAAAAAAAAAAAAAAHHHHHHHHHHHHHHHHHHHHHHHHH!!
I do believe this thing is bug free. Now, THAT is refreshing.
if I missed anything, then please let me know / remind me.
@varina & @oxwivi Tell me how those last compatibility instructions work for you. When I have working instructions for merging other contributions, I'll get them uploaded and cross referenced with the other contribs.
#39
Posted 10 February 2012 - 06:38 PM
Like I said before the addon in question was Minimum Product Quantity, with it's latest release in the last decade for osC 2.2. Will try to ascertain that all the function works with 2.3.1 and release tweaked codes and updated instructions.
#40
Posted 10 February 2012 - 07:29 PM
And NO, it isn't about the work being freely used. I have no problem sharing. It's about vultures waiting around for free contributions that they can take credit for and profit from. For example, this nice piece of work. Yes, I'm calling a pig a pig and a POS a POS.
With ezOSC's ONE-PAGE Checkout........
Don't Forget! ezOSC stands behind every piece of software we develop!
That mod was developed by itwebexperts, and hacked by me and several others. I never took credit for developing it. But, I'll be a son of a ....., when someone takes credit for developing THIS checkout, I think we just might have some issues. So yeah, vultures. If you're gonna get paid for MY work, you better at least give credit where it's due.
And yes, that was my rant for the day.
Edited by fulluvscents, 10 February 2012 - 07:37 PM.









