Ignore this. It was due to a missing } in the functions.php
I was staring at my screen for too long.
Ignore this. It was due to a missing } in the functions.php
I was staring at my screen for too long.
The uses of wc_cart_fragments_params
is j=a.ajax({url:wc_add_to_cart_params.wc_ajax_url.toString().replace("%%endpoint%%","get_variation")
in javascript file add-to-cart-variation.min.js and cart-fragments.min.js
The global variable wc_cart_fragments_params
will be defined as the script wc-cart-fragments
is loaded. This script is globally loaded, but may not loading due to override of any plugin or theme.
Since the script wc-cart-fragments
is not loading and the variable wc_cart_fragments_params
generated, we are getting the error Uncaught ReferenceError: wc_cart_fragments_params is not defined
.
To remove this error you can update the add-to-cart-variation.min.js changing the wc_cart_fragments_params
with wc_add_to_cart_params
.
or add this code to your theme
add_action( 'wp_print_scripts', 'my_localize_printed_scripts', 90 );
function my_localize_printed_scripts(){
wp_localize_script('woocommerce', 'wc_cart_fragments_params', array('ajax_url' => WC()->ajax_url(), 'wc_ajax_url' => WC_AJAX::get_endpoint("%%endpoint%%"), 'fragment_name' => 'wc_fragments') );
}
It's alright. I figured it out, by using either a gettext hook, or edit the string via Loco Translate plugin.
It isn't possible by default, but could be done with some customization.
This extension would get you most of the way there: https://woocommerce.com/products/woocommerce-quick-view/
So weird, it just suddenly started working fine again. I did nothing.
The tricky part is saving data from the cart page. The checkout form submission is where the order object is saved from - not the cart form.
You could perhaps collect the data in the calculate shipping area and pass it onto the checkout form with some hidden fields.
I do believe you are over complicating a rather easy thing though.
Here's the solution to this thread.
// Translate Subtotal to Subtotal (excl. GST)
function wc_translate_subtotal_excl_gst( $translated ) {
if ( get_option( 'woocommerce_prices_include_tax' ) === 'yes' ) {
$text = array(
'Subtotal:' => 'Subtotal (excl. GST):',
'Subtotal' => 'Subtotal (excl. GST)',
'小计:' => '小计(不含GST):',
'小计' => '小计(不含GST)',
);
$translated = str_ireplace( array_keys($text), $text, $translated );
}
return $translated;
}
add_filter( 'gettext', 'wc_translate_subtotal_excl_gst', 20, 3 );
The following filters were added to work alongside the above.
// Shopping Cart Product Price incl. Tax
function wc_cart_product_price( $product_price, $_product ) {
$incl_tax = $_product->get_price_including_tax();
return wc_price( $incl_tax );
}
add_filter( 'woocommerce_cart_product_price', 'wc_cart_product_price', 15, 2 );
// Shopping Cart Product Subtotal excl. Tax
function wc_cart_product_subtotal( $product_subtotal, $_product, $quantity, $object ) {
$row_price = $_product->get_price_including_tax( $quantity );
$incl_tax = wc_price( $row_price );
if ( ! $object->prices_include_tax && $object->tax_total > 0 ) {
$incl_tax .= ' <small class="tax_label">' . WC()->countries->inc_tax_or_vat() . '</small>';
}
return $incl_tax;
}
add_filter( 'woocommerce_cart_product_subtotal', 'wc_cart_product_subtotal', 15, 4 );
This is definitely being caused by your theme though. If you temporarily switch to a default WordPress theme, you shouldn't experience this issue.
You need to contact the theme authors about this.
The fatal error is likely being caused by another plugin or your theme. Try temporarily switching back to the WordPress Twenty Sixteen Theme, or Storefront, and disable all plugins except for WooCommerce. If that resolves the issue, then slowly re-enable features until you find the one that's causing the conflict.
You do need to update your PHP and MySQL versions though - those are very old. Contact your web host about that.
@melster777
What theme are you using on the site?
I would check to see if that theme supports using WooCommerce templates.
I am reviewing all my items in the Woo Commerce section to make sure my inventory count is correct getting started. When I visit my shop page it shows all the items - everything is accounted for and indicates the correct number of items in stock. HOWEVER, when I go to the Woo Commerce tab, and click on REPORTS, not all of the items show up in the inventory list - a good number of items are missing. Should that page self-populate, OR, do I need to go in and manually add the remaining inventory items that don't show up?
I allready tried to disable plugins which effects WC
Need to try with disabling all plugins, including translation ones - and also the theme.
I have put up a WooCommerce store on my website. I want to link/embed the store into my store mobile app. I tried a simple link but it looks wonky, is difficult to check out and sales tax is not being added either. What is the best way to integrate a woocommerce store into a business app? Is there a plugin?
Maybe just make some html edits so it is still found inside the similar elements: https://github.com/woothemes/woocommerce-gateway-stripe/blob/1e8eb0b791b22cfb3f56b06dd205aca46ea01e9d/assets/js/stripe.js#L134
If you need further help with customizations like this, you may need to hire a developer:
Thank you! I was looking into that one but wasn't sure it it would work on the cart page. Will try it out.
Hi,
I need to hide hole shipping option for a particular role of a user.
It is not free shipping, like wholesale customer can place their order through cheque gateway. then i will contact them and send invoice with shipping cost. it does not apply to retail customer.
can any one suggest me a solution. It will be really helpful
woocommerce 2.6.4
wordpress 4.6
Thanks in advance
Rabeya
Ok, thanks for your prompt response :) Great advice and I Really appreciate it. Hopefully it solves my problem, fingers crossed :)
On the shopping cart page, the cart totals are formatted as follows:
Subtotal $XX.XX
Shipping Domestic Flat Rate: $X.XX
Calculate Shipping
State Tax $X.XX
Total $XX.XX
But I would like to format it like this:
Subtotal $XX.XX
Shipping $X.XX Domestic Flat Rate
Calculate Shipping
State Tax $X.XX
Total $XX.XX
so that all the prices line up.
This same behavior occurs with the cost of shipping on the checkout page where it says, "Domestic Flat Rate: $X.XX" instead of "$X.XX Domestic Flat Rate."
Are there options somewhere that will allow me to change this formatting? If so, where are they located?
If I must code it myself, where can I find the files that control this display behavior?
Ok thanks for taking a look.
I can't figure it out either.
If anyone else gets it working please post your solution here!
I'm not sure if I'm explaining myself correctly. I'm selling prints in 3 different sizes and original one-off pieces. The first two sizes for the posters the shipping in the us is the same. the same shipping, at a different price though, is the also the size. the price goes up also.
Will the plugin be able to add the shipping costs together if someone purchases mutliple versions? or which should i used aside from the zones, because the shipping classes don't give me any option to edit anything.