jimlongo
Forum Replies Created
-
Forum: Plugins
In reply to: [WooCommerce] identify if particular product has been purchasedI’ve been looking at your plug-in page and that’s pretty interesting.
So in fact there are 4 products (1450, 1451, 1452, 1453) that could qualify you to checkout OR the proof of purchase code.
I’ll give it a whirl and see where it goes. I wouldn’t mind paying for or donating to such a thing. Do I need the Min Pro version to apply to all the contents of the cart?
Forum: Plugins
In reply to: [WooCommerce] identify if particular product has been purchasedI suppose that’s a possibility. It depends on how user friendly the whole process is, I hate to make things difficult for customers.
How would you accomplish that?
Thanks.
Forum: Plugins
In reply to: [WooCommerce] identify if particular product has been purchasedIt must be in the cart to access the main product catalog.
If $_SESSION[‘purchased’] = ‘true’ then when you click the link it redirects to the main catalog, otherwise it redirects to the single product i want you to buy.
Forum: Plugins
In reply to: [WooCommerce] identify if particular product has been purchasedHere’s my thinking . . .
in my plugin I put the following action hookadd_action( 'woocommerce_cart_contents' , 'nfp_purchased_photo'); function nfp_purchased_photo() { if( $product_id == '1450' ){ $_SESSION['purchased']= 'true'; } else{ continue; } }
this is trying to hook into woo commerce/cart.php which has this
do_action('woocommerce_cart_contents' );
Of course that is not doing what I want.
Any other hooks that you would think more appropriate?Forum: Plugins
In reply to: [WooCommerce] order details displays some leftover charactersI found it in my custom plugin.
Something in the update changed the behaviour of the function.Forum: Plugins
In reply to: [WooCommerce] Variable Prices & Add To Cart vanished since updatesince the previous version I have had the same issue.
No Add to Cart Button
No price.
Also the menu does not display the default variation.Totally broken.
Old thread indicate a missing /woocommerce/assets/js/frontend/add-to-cart-variation.min.js file but that is not the case here. That file is included at the bottom of the page.
Forum: Plugins
In reply to: [WooCommerce] appending info to product when added to cartadd_filter ('woocommerce_product_title' , 'nfp_add_id_to_product'); function nfp_add_id_to_product($title){ $code = substr($_SERVER['QUERY_STRING'],5,12); $filename = str_replace(array('-0', '-1'),array('-A', '-B'), $code); $title = $title . ' - ' . $filename ; return $title; }
This will add the string to the product name on the product page.
It is called Keychain – 012345, hooray
Except it doesn’t carry through to the cart boohooI’m working on this action hook also, but so far I can’t get it do anything . . . I’m not sure what the variable should be. If anyone has any clue I’d really appreciate your input.
add_action( 'woocommerce_.$product->product_type._add_to_cart' , 'add_filename' ); function add_filename($product_type) { $code = substr($_SERVER['QUERY_STRING'],5,12); $filename = str_replace(array('-0', '-1'),array('-A', '-B'), $code); $product_type = $product_type . ' - ' . $filename; return $product_type; }
Forum: Plugins
In reply to: [WooCommerce] appending info to product when added to cartI’ve confirmed that the $realcode is correct (12345-A)
function nfp_add_id_to_product($title){ $code = substr($_SERVER['QUERY_STRING'],5,12); $realcode = str_replace(array('-0', '-1'),array('-A', '-B'), $code); $title = $title . '-' . $realcode ; return $title; }
Seems like this should change the title of the product throughout – for instance “Keychain” should now become “Keychain-12345-A” but it isn’t doing anything.
Forum: Plugins
In reply to: [WooCommerce] appending info to product when added to cartI’m trying to use a filter action to add this info to the product_id
In my custom plug-in I have the following
/*ADD QUERY STRING TO PRODUCT WHNE PLACED IN CART */ add_filter ('woocommerce_product_title' , 'nfp_add_id_to_product'); function nfp_add_id_to_product(){ $code = substr($_SERVER['QUERY_STRING'],5,12); $realcode = str_replace(array('-0', '-1'),array('-A', '-B'), $code); $product_id = $realcode . '&' . $product_id ; return $product_id; }
But all that gets passed to the cart is &, so I’m guessing the filter happens after we leave the page and cant’ grab the query string.
Any ideas of what I could try.
I also tried an add_to_cart action but I don’t feel like that is going to be completely useful.
Thanks.
Forum: Plugins
In reply to: [WooCommerce] Change color of textYou probably need to learn to use Firebug extension in Firefox or something similar.
That will show the the css that is doing that. Then you can edit the css files.
Otherwise you’re probably stuck with what the theme is giving you.Forum: Plugins
In reply to: [WooCommerce] Removing Direct Bank Transfer and Cheque Payment from checkoutGo to your admin section.
Go to WooCommerce Settings Section.
Across the top of page you can find tabs one of which will be “Payment Gateways”
Now you will see links under the tabs for Bacs and Cheque
Click each of those and uncheck the enable button.Forum: Plugins
In reply to: [WooCommerce] extract database query into templatesThat’s It!
$order->id makes either versions of the code run,
get_post_meta as well as $wpdb->get_varThanks again.
Forum: Plugins
In reply to: [WooCommerce] extract database query into templatesAre you referring to the wp_posts table?
There is a row with ID 128I am in the woocommerce thankyou.php template and it is pulling information such as <?php echo $order->get_order_number(); ?> successfully.
Forum: Plugins
In reply to: [WooCommerce] extract database query into templatesYes the example you just posted pulls the data. That is if I put the literal 128.
But it doesn’t work with $order->post_idForum: Plugins
In reply to: [WooCommerce] extract database query into templatesI know the data exists, I can query the database and return it.
SELECT meta_value FROM wp_postmeta
WHERE post_id = 128 AND meta_key = ‘_mycustomfield’