Your question should be specific to WordPress. Generic PHP/JS/HTML/CSS questions might be better asked at Stack Overflow or another appropriate site of the Stack Exchange network. Third party plugins and themes are off topic.
Closed 11 years ago.
Improve this questionMy client would like two 'Place order' buttons on his checkout page (/?set-cart-qty_2652=1).
By default, the 'Commander' (his site is in French) button is at the bottom of the page. I'm trying to add a second one in the right hand column at the top of the page.
I think form-checkout.php is what I need to modify. I think I need to add it where the shipping column usually is (not used here because it is a virtual product).
If anyone has any pointers I'd be really grateful.
Thanks.
Closed. This question is off-topic. It is not currently accepting answers.Your question should be specific to WordPress. Generic PHP/JS/HTML/CSS questions might be better asked at Stack Overflow or another appropriate site of the Stack Exchange network. Third party plugins and themes are off topic.
Closed 11 years ago.
Improve this questionMy client would like two 'Place order' buttons on his checkout page (http://www.jobgrandprix.fr/checkout/?set-cart-qty_2652=1).
By default, the 'Commander' (his site is in French) button is at the bottom of the page. I'm trying to add a second one in the right hand column at the top of the page.
I think form-checkout.php is what I need to modify. I think I need to add it where the shipping column usually is (not used here because it is a virtual product).
If anyone has any pointers I'd be really grateful.
Thanks.
Share Improve this question asked Mar 21, 2014 at 12:20 Mai LingMai Ling 311 gold badge1 silver badge3 bronze badges 1- you need to add it within the checkout form, just add a similar submit button, but inside the checkout form – Kumar Commented Mar 21, 2014 at 12:49
1 Answer
Reset to default 2Place Order Button can't go out of the <form></form>
element. What you can do is you can duplicate the button within the element but at the top. like this:
For this:
Withing you child theme make a folder woocommerce
and inside that checkout
.
Now go to wp-content\plugins\woocommerce\templates\checkout
and copy form-checkout.php
file and paste that into MY_CHILD_THEME\woocommerce\checkout
folder and edit it.
WHY ABOVE STEP? So that you won't edit the core woocommerce files and the update will be lost when this plugin updates in future. The above structure overrides the core template file.
OK NOW EDIT form-checkout.php
Below
<form name="checkout" method="post" class="checkout" action="<?php echo esc_url( $get_checkout_url ); ?>">
Add the Button Code and it should look like this.
<form name="checkout" method="post" class="checkout"
action="<?php echo esc_url( $get_checkout_url ); ?>">
<div class="form-row place-order">
<noscript>Since your browser does not support JavaScript, or it is disabled,
please ensure you click the &lt;em&gt;Update Totals&lt;/em&gt;
button before placing your order. You may be charged more than the amount
stated above if you fail to do so.&lt;br/&gt;&lt;input type="submit"
class="button alt" name="woocommerce_checkout_update_totals"
value="Update totals" /&gt;</noscript>
<input
type="hidden" id="_wpnonce" name="_wpnonce"
value="c82a4af261"><input type="hidden" name="_wp_http_referer"
value="/woocommerce2/wp-admin/admin-ajax.php" />
<input
type="submit" class="button alt" name="woocommerce_checkout_place_order"
id="place_order" value="Place order" data-value="Place order" />
</div>
<?php if ( sizeof( $checkout->checkout_fields ) > 0 ) : ?>
Save it and Bingo. You can do some CSS and align the button to the right side of the form element. But remember it can't go out of <form></form>
element.
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744936585a4602062.html
评论列表(0条)