fizcoder
Forum Replies Created
-
That’s very useful. Many thanks for that.
thanks for clarifying π you can close this post.
- This reply was modified 7 years, 10 months ago by fizcoder.
ok thanks.
Will anything be prompted on checkout if it’s unsupported?
Or can it be displayed in their currency when checking out but will show the default currency? for example:
10 EUR (15 USD) or something like that?
Excellent thanks!
So I need to add the currencies in the backend that is supported by my payment gateway for example PayPal and Stripe.
This issue still exists.
It seems that it doesn’t load the exact URL path that is in the media browser. For example:
The URL path in the media browser is:
https://example.cloudfront.net/wp-content/uploads/2018/07/03223202/image.png
and Visual Composer sees that image too and loads it correctly in the backend. However when viewing in the frontend it changes to:
https://example.cloudfront.net/wp-content/uploads/2018/07/image.png?id=7788
It doesn’t take into account the additional directory after the date /2018/07/
Do you know why that is?
I found a way to modify the text. Thanks.
Forum: Plugins
In reply to: Custom post type permalink within another custom post type*bump*
Forum: Plugins
In reply to: Woocommerce – Add To Cart and Buy Now buttons on Product PagesI managed to resolve this by finding this blog post http://samplacette.com/skip-shopping-cart-in-woocommerce/.
If anyone else finds that they are struggling to implement this, this is how I did it (might not be the best solution but it works for me):
I copied the following text into my theme functions.php
/** * Set cart item quantity action * * Only works for simple products (with integer IDs, no colors etc) * * @access public * @return void */ function woocommerce_set_cart_qty_action() { global $woocommerce; foreach ($_REQUEST as $key => $quantity) { // only allow integer quantities if (! is_numeric($quantity)) continue; // attempt to extract product ID from query string key $update_directive_bits = preg_split('/^set-cart-qty_/', $key); if (count($update_directive_bits) >= 2 and is_numeric($update_directive_bits[1])) { $product_id = (int) $update_directive_bits[1]; $cart_id = $woocommerce->cart->generate_cart_id($product_id); // See if this product and its options is already in the cart $cart_item_key = $woocommerce->cart->find_product_in_cart( $cart_id ); // If cart_item_key is set, the item is already in the cart if ( $cart_item_key ) { $woocommerce->cart->set_quantity($cart_item_key, $quantity); } else { // Add the product to the cart $woocommerce->cart->add_to_cart($product_id, $quantity); } } } } add_action( 'init', 'woocommerce_set_cart_qty_action' );And then I modified *theme*/woocommerce/single-product/add-to-cart/simple.php (make sure you don’t midify the plugin files so make a copy and paste into your theme files into a woocommerce folder) to the following (notice that I had removed my quantity input from my code so if you need it, ensure you rework the code to get it working):
<form class="cart single-product" method="post" enctype='multipart/form-data'> <?php do_action( 'woocommerce_before_add_to_cart_button' ); ?> <input type="hidden" name="add-to-cart" value="<?php echo esc_attr( $product->id ); ?>" /> <button type="submit" class="single_add_to_cart_button button alt cart-buttton add-to-cart"><?php echo $product->single_add_to_cart_text(); ?></button> <?php do_action( 'woocommerce_after_add_to_cart_button' ); ?> </form> <form class="cart single-product" method="post" enctype='multipart/form-data' action="/checkout?set-cart-qty_<?php echo $product->id;?>=1"> <button type="submit" class="single_add_to_cart_button button alt cart-buttton buy-now">Buy Now</button> <input type="hidden" name="add-to-cart" value="<?php echo esc_attr( $product->id ); ?>" /> </form>I added another button next to the existing Add to Cart button but separating the form. The blog post mentions that you can add a hyperlink instead but the above worked for me in terms of the way I needed to customise the page (slightly more long winded)
From blog:
Usage instructions:
Create a hyperlink with a query string argument like so:
<url>?set-cart-qty_<product ID>=<quantity>
Where <product ID> is the numerical ID of your product (something like β167β) and <quantity> is the >quantity you want set in the userβs shopping cart (most likely this will just be β1β).Example URL to send user to checkout with exactly one item of product with ID β167β in cart:
I hope the above helps anyone who has a similar problem as I had.
Forum: Themes and Templates
In reply to: Create Widget Section in a Metabox of a Page/PostFantastic!
I will give this a go and let you know how it goes π
Cheers David!
Forum: Themes and Templates
In reply to: Create Widget Section in a Metabox of a Page/PostHi David. Thank you very much for your help. This has given me some guidance.
Is there a script on the link you have provided which will provide me with how to create the drop down to call the custom posts?
Thanks very much for all the help.
Forum: Themes and Templates
In reply to: Create Widget Section in a Metabox of a Page/PostThanks David for your response.
Basically I want to be able to add custom messages on the right hand side depending on the content of the page/post.
For example, if the page was about a particular topic, I would like to add an image, some additional text and maybe a form on the right hand side unique to that particular page.
So if I create another page/post which is about something else, I would like to have another image, text and form on the right hand side.
It might be a good idea to create shortcodes separately and then call them into the post/page using a drop down.
Is it possible to create another admin section called “Custom Page/Post Widgets” and within there you can add a new “widget set” and when you add a new set it can be similar to the drag and drop in the widget area but when you click save you be given a shortcode and perhaps in the post/page, there can be a dropdown of all the different “widget sets”.
I hope that makes sense.
Thanks
Fiz