Forum Replies Created

Viewing 10 posts - 21 through 30 (of 75 total)
  • Author
    Posts
  • in reply to: Add Title Field to Checkout #30324

    Hi,

    Thank you for that. I have used AceIde however having issues saving. The WordPress editor gives me error above, however if I refresh page and then edit , it is fine.

    I have used your links however I am having problems placing the position at the top next to :
    Title * , First Name * , Last Name * are all on one row.

     

    Using:

     

    add_action(‘woocommerce_after_order_notes’, ‘customise_checkout_field’);
    function customise_checkout_field($checkout)
    {

    woocommerce_form_field(‘title’, array(
    ‘label’ => __(‘Title’, ‘woocommerce’),
    ‘required’ => true,
    ‘class’ => array(‘form-row-wide’),
    ‘type’ => ‘select’,
    ‘options’ => array(‘Mr’ => __(‘Mr’, ‘woocommerce’), ‘Mrs’ => __(‘Mrs’, ‘woocommerce’), ‘Miss’ => __(‘Miss’, ‘woocommerce’))
    ), $checkout->get_value(‘title’));

    }

    /**
    * Checkout Process
    */
    add_action(‘woocommerce_checkout_process’, ‘customise_checkout_field_process’);
    function customise_checkout_field_process()
    {
    // if the field is set, if not then show an error message.
    if (!$_POST[‘title’]) wc_add_notice(__(‘Please enter Title’) , ‘error’);
    }

    https://ipac.donate.studio/wp-admin/theme-editor.php?file=functions.php&theme=claue-child

    Any help in getting the Title in the correct position would be much appreciated.

    I have looked at Priority @
    https://docs.woocommerce.com/document/tutorial-customising-checkout-fields-using-actions-and-filters/#section-4

    but could not figure it out.
    Any help would be much appreciated.
    Kind Regards,
    Rizwan

    in reply to: Add Title Field to Checkout #30320

    Hi Harry,

    Thank you for links. I have been trying to add Title field to funtions.php of child theme however getting the error message:

    I have seen else where this code, which might work but, says I cannot edit templete.

    $address_fields[‘title’] = array(
    ‘label’ => __(‘Title’, ‘woocommerce’),
    ‘required’ => false,
    ‘class’ => array(‘form-row-custom’),
    ‘type’ => ‘select’,
    ‘options’ => array (” => __(‘Select option’, ‘woocommerce’), ‘MR’ => __(‘Mr’, ‘woocommerce’), ‘MRS’ => __(‘Mrs’, ‘woocommerce’), ‘MISS’ => __(‘Miss’, ‘woocommerce’), ‘MS’ => __(‘Ms’, ‘woocommerce’), ‘DR’ => __(‘Dr’, ‘woocommerce’))
    );

    On the Checkout page before the First Name, need the Title filed as a Select drop down and a mandatory filed, SO

    Title * , First Name * , Last Name * are all on one row.

    I have been trying, I hope you can help me with this.
    Many thanks and alias  appreciate all your help.

    Kind Regards,
    Rizwan

    in reply to: Getting the Price to appear in text box #30135

    Hi Harry / Kathy,

    Many Thanks for your help in displaying the piece on Home Screen for Variable / Suggested price.

    1. @Kathy, @Rizwan if i add below code it will show suggest price but hide minimum price on catalog page http://prntscr.com/n67df5

    /**
    * Change price string for Variable Products .
    */
    function kia_filter_variable_product_price_html( $html, $product ) {
    $children = $product->get_children();
    if( ! empty( $children) ) {
    foreach( $children as $child_id ){
    $html = WC_Name_Your_Price_Helpers::get_suggested_price_html( $child_id );
    break;
    }
    }
    return $html;
    }
    add_filter( ‘woocommerce_variable_nyp_html’, ‘kia_filter_variable_product_price_html’, 10,

     

    I have used this script and updated all products to Suggested price.

    Another good price of news is that the Phone Plugin developer managed to add Suggested price to auto search drop down. So from my requirements for OPTION 1, they are all complete.

    Many Thanks for yourself Harry and Kathy, since without your help and coding skills this would not have been possible.

    Great Support and help and always much appreciated.
    Kind Regards,
    Rizwan

    in reply to: Getting the Price to appear in text box #30116

    Hi Kathy,

    Many Thanks for your help and advice.

    Its just the Phone Orders for WooCommerce (Pro) plugin for Simple & variable Products does not display the price and only will if I assign a minimum price.

    I would have used Simple Products if they align with our requirements, however even with Simple Products, I will have this issue of not displaying the suggested price @

    One of the Where Most Needed Donations is a Simple Product, with suggested price however this price is not displayed in the image above, which is not over-complicated.

    I hope we can find a solution and appreciate all your help.
    Many Thanks,
    Rizwan

    in reply to: Getting the Price to appear in text box #30114

    Hi Harry,

    Many Thanks for your help.

    2. @Rizwan
    2. Since I need the price to be added, the developer has suggested:

    you can tweak this code to adjust price for cart item

    add_filter(“wpo_prepare_item”, function($item, $product){
    if($item[‘item_cost’] == 0)
        $item[‘item_cost’] = 10;
    return $item;
    },10,2);

     

    I hope this helps and we can pull the suggested price into the cart.

    1. @Kathy, @Rizwan if i add below code it will show suggest price but hide minimum price on catalog page http://prntscr.com/n67df5

    If we can get item 2. fixed in terms of pulling the suggested price into the auto complete drop down and then that populating the cart form, then what you have done here:

    http://prntscr.com/n67df5

    Is fine, since I will not need to use Minimum price on the home page (https://ipac.store/) , however use  the Suggested price, which will complete my requirements for OPTION 1 (on page 2 of this thread)

    I will then be able to change all Donations / Products into Suggested prices.

    Many Thanks for your help and continued support.
    Kid Regards,
    Rizwan

     

    in reply to: Getting the Price to appear in text box #30102

    Hi Harry,

    As the issue of suggested price for variable products was solved, please can you have a look at using the same method to add the suggested price to the autocomplete drop down here:

    https://ipac.store/phone-orders-frontend-page

    Now this issue I have here is when you click on:
    Find Products…
    and type in Where Most Needed
    It will auto complete and find the following:

    However as you can see the price is From: £0.00. It is not pulling the suggested price. So I can see from view script it is not loading the name-your-price.js file, so is this a similar issue to the problem which was just solved by using:
    https://gist.github.com/helgatheviking/bc372086690e5d315e7aced3aeb1062b

    If you could help with these issues what would be much appreciated and would enable us to start taking the site live and hopefully benefit those who are in Need.

    The plugin developer has suggested to use this hook to tweak text in product autocomplete .

    add_filter( ‘wpo_autocomplete_product_custom_output’, function($custom_text, $product ){
    $custom_text = $product->get_id(). ” – ” . $product->get_name();// add more fields?
    return $custom_text;
    },10,2);

    Any help in this matter would be greatly appreciated.
    Many Thanks
    Rizwan

    in reply to: Getting the Price to appear in text box #30101

    Hi Harry,

    Please can you see if you can get the price to appear underneath Where Most Needed for Variable suggested price, please see image above, (the middle image).

    Hopefully you can use the script Kathy has written to get the value, and get it displayed under the image.
    Many Thanks for your continued support.
    Kind Regards,
    Rizwan

    in reply to: Getting the Price to appear in text box #30060

    Hi Kathy,

    Sorry I think their is some misunderstanding. The suggested price £10 is displaying on theme for simple product.

    I tested it, it is the right hand Where Most Needed Simple Product.
    The middle one is the old Variable suggested price
    And the right is the minimum price one.

    Its just the Phone Orders for WooCommerce (Pro) plugin for Simple  & variable Products does not display the price and only will if I assign a minimum price.

    Thank you for child theme suggestion and this would be the best way, if we use your code.
    Many Thanks again for your help and advice.
    Much Appreciated,
    Rizwan

    in reply to: Getting the Price to appear in text box #30058

    Hi Kathy,

    Many Thanks for your help and suggestions, it is much appreciated.

    “Could you make do with each product being a simple product in lieu of a variable product? They are a lot easier to work with. You’ll automatically get a “Suggested Price” string which can be modified from the settings.”

    I tried this and can be seen on Home page:
    https://ipac.store/

    It fixed the issue of showing the amount under Where Most Needed, however since a minimum price is not set, I still would get From: £0.00 from:

    https://ipac.store/phone-orders-frontend-page

    When Searching for Where Most Needed

    However, if the suggested amounts are the same across all variations you could perhaps get away with the following, though it may not be very performant. You only have 3 variations, so perhaps get_children() won’t be that slow.

    Yes suggested amounts would be the same.
    Would your script:

    /**
    * Change price string for Variable Products .
    */
    function kia_filter_variable_product_price_html( $html, $product ) {
    $children = $product->get_children();
    if( ! empty( $children) ) {
    foreach( $children as $child_id ){
    $html = WC_Name_Your_Price_Helpers::get_suggested_price_html( $child_id );
    break;
    }
    }
    return $html;
    }
    add_filter( ‘woocommerce_variable_nyp_html’, ‘kia_filter_variable_product_price_html’, 10, 2 );

    Be able to do 1 & 2 from request above, add price text under product name, and add From: £(suggested price), when searching on the page:
    https://ipac.store/phone-orders-frontend-page

    If this is the case, it would be great and fix these issues.
    If this is the case, then Harry can you please add this script to get the suggested price to appear

    Below the middle Where Most Needed, which is a Suggested price for a variable product.

    I will make a request to the developer of the Phone Orders for WooCommerce (Pro) plugin to use this script to get the From: £(suggested price) also.

    Many Thanks or all your help, it is much appreciated.
    Kind Regards,
    Rizwan

    in reply to: Getting the Price to appear in text box #30051

    Hi Kathy / Harry,

    Many Thanks for all your help with this, it is much appreciative and without your help this would have not been possible, so I really do appreciate your knowledge and problem solving skills in directing Harry. Harry many thanks also for using Kathy ‘s method, it works very well and is very much appropriated from both of you.

    I know just have the final dilemma to solve:

    Since the site is a Donation, ideally I would like the Donor to Donate however much they can afford. So for example for WATER which is set as a minimum price of £30 and the Donor only has £10 would like him to be able to Donate £10 for Water. So in this case we can use the method of Suggested price as in the example of WHERE MOST NEEDED on home page however it throws up some issues which need to be solved:

    1.  Under Where Most Needed text on Home page, I need the suggested price to be displayed as in this case £10 below the text as it is in Water £30.


    2. I am using a plugin called – Phone Orders for WooCommerce (Pro)

    Phone Orders for WooCommerce (Pro)

    I am using this to take Donations from Donors when they call the Charity. The primary aim is to login, search for an existing Donor and if they exist to assign a Donation Allocation (i.e Water, Food etc..) to them and then checkout as you would normally from the website and once all complete to go back to the main phone donation page again which is @

    https://ipac.store/phone-orders-frontend-page

    Now this issue I have here is when you click on:
    Find Products…
    and type in Where Most Needed
    It will auto complete and find the following:

    However as you can see the price is From: £0.00. It is not pulling the suggested price. So I can see from view script it is not loading the name-your-price.js file, so is this a similar issue to the problem which was just solved by using:
    https://gist.github.com/helgatheviking/bc372086690e5d315e7aced3aeb1062b

    If you could help with these issues what would be much appreciated and would enable us to start taking the site live and hopefully benefit those who are in Need.

    Else

    If 1 & 2 where tricky, then to have the ability somehow for a Donation of lower than the minimum price to go through in the shopping cart and be added, this would means all the other Donation Allocations we have on the home page

    https://ipac.store/

    Except Where Most Needed would work and I could change this to a minimum price also.

    Any suggestions or help in this matter would be very much appreciated. I really do appreciate all the help so far also.

    Kind Regards,
    Rizwan

Viewing 10 posts - 21 through 30 (of 75 total)