ilanb
Forum Replies Created
-
Hi Rashed,
Already use this shortcode and per_page argument, but pagination always missing…
Thx
Thx Rashed,
I wrote this, but not sure how get the ID of vendor desactivated:
function delete_product_pharma_whendisabled( $user_id ) { global $wpdb; $wpdb->get_results($wpdb->prepare("DELETE FROM {$wpdb->prefix}geo_location WHERE user_id = '%d'", $user_id)); $wpdb->get_results($wpdb->prepare("DELETE FROM {$wpdb->prefix}postmeta WHERE user_id = '%d'", $user_id)); $wpdb->get_results($wpdb->prepare("DELETE FROM {$wpdb->prefix}posts_users WHERE user_id = '%d'", $user_id)); } add_filter( 'dokan_vendor_disabled', 'delete_product_pharma_whendisabled');
Thanks sohanhossain, resolved ??
Forum: Plugins
In reply to: [WooCommerce] Trying to change order author ID by custom cart_item_dataWorking with:
function pharmizz_checkout_process() { global $wpdb; foreach ( WC()->cart->get_cart() as $cart_item_key => $cart_item ) { $pdt_id = $cart_item['product_id']; $ph_id = $cart_item['pharmacie_id']; $wpdb->get_results($wpdb->prepare("UPDATE {$wpdb->prefix}posts SET post_author = '%d' WHERE ID = '%d'", $ph_id, $pdt_id)); } }
Forum: Plugins
In reply to: [WooCommerce] Trying to change order author ID by custom cart_item_dataTried to change change value when checkout process without success:
add_action('woocommerce_checkout_process', 'pharmizz_checkout_process'); function pharmizz_checkout_process() { global $wpdb; foreach ( WC()->cart->get_cart() as $cart_item_key => $cart_item ) { $_product = apply_filters( 'woocommerce_cart_item_product', $cart_item['data'], $cart_item, $cart_item_key ); if ( $_product && $_product->exists() && $cart_item['quantity'] > 0 && apply_filters( 'woocommerce_checkout_cart_item_visible', true, $cart_item, $cart_item_key ) ) { $wpdb->get_results($wpdb->prepare("UPDATE {$wpdb->prefix}posts SET post_author = {$cart_item['pharmacie_id']} WHERE ID = '%d'", $cart_item['product_id'])); } } }
Forum: Plugins
In reply to: [WooCommerce] Trying to change order author ID by custom cart_item_dataActualy if I create custom add to cart like:
add_action('woocommerce_add_to_cart', 'custom_action_add_to_cart', 20, 6); function custom_action_add_to_cart($cart_item_key, $product_id, $quantity, $variation_id, $variation, $cart_item_data) { $pharmacie_id = urldecode($_GET['pharmacie_id']); global $wpdb; $wpdb->get_results($wpdb->prepare("UPDATE {$wpdb->prefix}posts SET post_author = {$pharmacie_id} WHERE ID = '%d'", $product_id)); }
Order works fine, but problem occur if another user try to add same product from other seller…
Same problem for me error 500
Hi Kas5986,
That sound good ??
Where I can download your plugin ? no link on your demo siteThanks
Hi Sabbir,
Thanks for understanding user point of view ??
Ilan
Just reply here my email:
Ok I can understand for policy… But isn’t logic that this simple search function is not include by default… a search by address and zip for a store is basic, and user never search by name first…
But I suppose you encourage work for third party developper ?
I’ts my two cent’s analyse.
Anyway thanks for provide part of request.
Hi,
I’v shared full code with support but no response from it!
Thx