need help with custom code include ajax, php , js
Budget: $30 – $250 USD
this is what the code incloude i think we need to update something on the 3 function but ill let you as expert tell me what need to be done.
problems that i see:
1. add to cart notfication not showing.
2. after adding to the cart if i refresh the page ill get notfication related to coupon codes that should not show as i know
wp_head_ajax_url function: This function writes a JavaScript snippet into the <head> of the page. The purpose is to define a JavaScript variable ajaxurl, which represents the URL of the WordPress AJAX handling script.
sb_wp_footer function: This function is added to the wp_footer hook, meaning it will be executed when the WordPress theme is about to output the closing </body> HTML tag. The function first checks if a product is already in the cart and removes it if so. Then, it checks if the current page is a product page and if it's an "upgrade" product. For such products, it appends a script to the footer of the page.
sb_check_out_of_stock function: This function is executed in response to an AJAX request with the action "sb_check_out_of_stock". It checks the stock status of all the related products in the request, and adds them to the cart if they're in stock. The function returns a JSON response indicating whether the operation succeeded.
add_the_date_validation function: This is a function that seems to have been commented out and is not currently being used. If it was being used, it would check if certain product fields have been filled out before allowing the product to be added to the cart.
custome_add_to_cart function: This is another commented out function. If used, it would handle adding products to the cart in a custom way.
sb_woocommerce_add_cart_item_data function: This function adds related product information to cart items.
sb_woocommerce_get_item_data function: This function seems to append related products data to the item data.
sb_woocommerce_checkout_create_order_line_item function: This function adds related products information to the order items during checkout.
sb_woocommerce_product_options_advanced function: This function adds a checkbox to the product edit screen that allows the admin to mark a product as an "upgrade" product.
sb_woocommerce_process_product_meta function: This function saves the value of the "upgrade" checkbox when a product is saved.
problems that i see:
1. add to cart notfication not showing.
2. after adding to the cart if i refresh the page ill get notfication related to coupon codes that should not show as i know
wp_head_ajax_url function: This function writes a JavaScript snippet into the <head> of the page. The purpose is to define a JavaScript variable ajaxurl, which represents the URL of the WordPress AJAX handling script.
sb_wp_footer function: This function is added to the wp_footer hook, meaning it will be executed when the WordPress theme is about to output the closing </body> HTML tag. The function first checks if a product is already in the cart and removes it if so. Then, it checks if the current page is a product page and if it's an "upgrade" product. For such products, it appends a script to the footer of the page.
sb_check_out_of_stock function: This function is executed in response to an AJAX request with the action "sb_check_out_of_stock". It checks the stock status of all the related products in the request, and adds them to the cart if they're in stock. The function returns a JSON response indicating whether the operation succeeded.
add_the_date_validation function: This is a function that seems to have been commented out and is not currently being used. If it was being used, it would check if certain product fields have been filled out before allowing the product to be added to the cart.
custome_add_to_cart function: This is another commented out function. If used, it would handle adding products to the cart in a custom way.
sb_woocommerce_add_cart_item_data function: This function adds related product information to cart items.
sb_woocommerce_get_item_data function: This function seems to append related products data to the item data.
sb_woocommerce_checkout_create_order_line_item function: This function adds related products information to the order items during checkout.
sb_woocommerce_product_options_advanced function: This function adds a checkbox to the product edit screen that allows the admin to mark a product as an "upgrade" product.
sb_woocommerce_process_product_meta function: This function saves the value of the "upgrade" checkbox when a product is saved.