JBIRD1111
Forum Replies Created
-
Forum: Plugins
In reply to: [Woocommerce Radio Buttons] adding prices next to radio buttonsThis solved it for me: https://webroxtar.com/2013/07/get-regular-and-sale-prices-of-product-variations-in-woocommerce/
#Step 1: Get product varations
$available_variations = $product->get_available_variations();#Step 2: Get product variation id
$variation_id=$available_variations[0][‘variation_id’]; // Getting the variable id of just the 1st product. You can loop $available_variations to get info about each variation.#Step 3: Create the variable product object
$variable_product1= new WC_Product_Variation( $variation_id );#Step 4: You have the data. Have fun ??
$regular_price = $variable_product1 ->regular_price;
$sales_price = $variable_product1 ->sale_price;Forum: Plugins
In reply to: [Woocommerce Radio Buttons] adding prices next to radio buttonsThis code does not work for me either. I need to place the variation prices next to each radio button, and the above code does not seem to have any effect on the price. I have searched and have not found another solution. Any ideas?
I also implemented these changes with no effect: https://stackoverflow.com/questions/12272733/woocommerce-get-variation-product-price
Forum: Plugins
In reply to: [WooCommerce] Changing text for product add to cart errorI will read up on translating this file. I will post any questions here, thanks!
Forum: Plugins
In reply to: [WooCommerce] Changing text for product add to cart errorIt seems like there has to be a better way than localization when it comes to this. Your right, there are no hooks in the snippet I provided. I personally do not know anything about localization – is the process simple? It doesn’t necessary seem like the correct way to go about this! Thoughts?
Forum: Plugins
In reply to: [WooCommerce] Changing text for product add to cart errorThe code is not within a template file – rather it is in class-wc-cart.php which is in the classes directory of the plugin.
Im not sure what you mean by localizing it. How about using the function.php file to write a custom action / filter?
Fxxed it! Using <?php wp_reset_query(); ?>
Turns out I identified what is causing the problem, but I still cannot figure out why. In my header.php file, I loop through the custom post type, “options panel” which is the exact same post type that is showing up problematically. When I remove the loop from the header, everything works fine. The problem, is that I need to use that loop in my header. The loop look like this: (any ideas?)
[Code moderated as per the Forum Rules. The maximum number of lines of code that you can post in these forums is ten lines. Please use the pastebin]
My solution is the following code, where
lista
is replaced by the custom field id, and the unordered list,ul#duplist
separates each group.<ul id="duplist"> <li> <?php $lista = get_post_custom_values('lista', $post->ID); foreach ( $lista as $key => $value ) { echo $value . '</li><li>'; } ?> </li> </ul>