Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Buy Now With 1 Click Rate Topic   - - - - -

 
  • atseros
  • Member
  • Trial users
  • Join Date: 20-Nov 15
  • 15 posts

Posted 27 November 2015 - 07:16 AM #1

is there a way to add more input fields in the 1 click buy ?

 

i would be interested in adding, address, region, date and time...

 

 



 
  • oleg.gorshkov
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 06-Dec 13
  • 2960 posts

Posted 27 November 2015 - 07:31 AM #2

Yes, you can edit the design/themes/responsive/templates/addons/call_requests/views/call_requests/components/call_requests_content.tpl file.

 

To add a field, you this code as an example:

<div class="ty-control-group">
    <label for="call_data_{$id}_address" class="ty-control-group__title{if !$product} cm-required{/if}">{__("address")}</label>
    <input id="call_data_{$id}_address" class="ty-input-text-full" size="50" type="text" name="call_data[address]" value="{$call_data.address}" />
</div>

Then open the app/addons/call_requests/func.php and find the fn_call_requests_placing_order function. Add your data to $cart['user_data']. For example:

    $cart['user_data']['s_address'] = $params['address'];    
    $cart['user_data']['b_address'] = $params['address'];

After the following code:

    foreach (array('b_address', 's_address', 'b_city', 's_city', 'b_country', 's_country', 'b_state', 's_state') as $key) {
        if (!isset($cart['user_data'][$key])) {
            $cart['user_data'][$key] = ' ';
        }
    }

Make sure you use the same fields the standard user_data uses. You can browse the ?:orders DB table structure to find out what columns it includes. Make sure you use one of them in your $cart['user_data']


Simtech Development | sales@simtechdev.com | www.simtechdev.com
CERTIFIED CS-CART PARTNER | LICENSES | DEVELOPMENT | ADD-ONS | DESIGN | UPGRADE

Mega SEO Package - All you need for your SEO


 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 17997 posts

Posted 27 November 2015 - 08:10 AM #3

Note that this solution will work with the default set of profile fields only. If you need to use additional fields, more complex modification is requried


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • Peter000
  • Newbie
  • Trial users
  • Join Date: 23-Feb 16
  • 7 posts

Posted 17 January 2017 - 12:49 AM #4

@oleg.gorshkov

 
Did not quite understand how to use your solution. 
How to show the Address info in the backend? Thanks!


 
  • alijaved
  • Advanced Member
  • Members
  • Join Date: 14-Apr 18
  • 90 posts

Posted 04 July 2018 - 11:37 AM #5

How can I add a note "Shipping charges applied" on buy now with 1 click pop up?



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 17997 posts

Posted 04 July 2018 - 01:12 PM #6

How can I add a note "Shipping charges applied" on buy now with 1 click pop up?

 

What do you mean? Please clarify


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • alijaved
  • Advanced Member
  • Members
  • Join Date: 14-Apr 18
  • 90 posts

Posted 04 July 2018 - 01:52 PM #7

What do you mean? Please clarify

 

Ok I want to add a text on a "buy now with one click" Pop-up window below the e-mail field on the Buy now with 1 click Pop up window

 

Please see this image so you can understand
http://prntscr.com/k2h6t8



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 17997 posts

Posted 05 July 2018 - 05:44 AM #8

design/themes/THEME/templates/addons/call_requests/views/call_requests/components/call_requests_content.tpl

 

You can add necessary text before the following line of code:

<div class="cr-popup-error-box">

If you are familiar with hooks, please use the call_requests:call_requests_form hook to override buy in 1 click content


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • alijaved
  • Advanced Member
  • Members
  • Join Date: 14-Apr 18
  • 90 posts

Posted 08 July 2018 - 10:35 AM #9

design/themes/THEME/templates/addons/call_requests/views/call_requests/components/call_requests_content.tpl

 

You can add necessary text before the following line of code:

<div class="cr-popup-error-box">

If you are familiar with hooks, please use the call_requests:call_requests_form hook to override buy in 1 click content

 

 

Please tell me how can I add text ?

 

Should I add this line 

 

<p>Shipping Rates Applied</p>

 

?

Can you please give an example



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 17997 posts

Posted 09 July 2018 - 06:07 AM #10

Please tell me how can I add text ?

 

Should I add this line 

 

<p>Shipping Rates Applied</p>

 

?

Can you please give an example

 

Yes, your example is correct. If you have several languages in your store, use language variables

<p>{__('shipping_rates_applied')}</p>

Then go to Administration -> Languages -> Translations  and add shipping_rates_applied language variable with required values for different languages


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • alijaved
  • Advanced Member
  • Members
  • Join Date: 14-Apr 18
  • 90 posts

Posted 09 July 2018 - 08:30 AM #11

Yes, your example is correct. If you have several languages in your store, use language variables

<p>{__('shipping_rates_applied'}</p>

Then go to Administration -> Languages -> Translations  and add shipping_rates_applied language variable with required values for different languages

 

 

I tried this, it is not working, after adding that line and adding language variable from the admin panel, I try to click on buy now with 1 click button and it did not even open the pop-up nothing happened.

 

I did not do anything related to hooks, please let me know If I am doing something wrong?



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 17997 posts

Posted 09 July 2018 - 12:40 PM #12

Please post here full content of the call_requests_content.tpl file (use Code functionality in the WYSIWYG editor above)


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • alijaved
  • Advanced Member
  • Members
  • Join Date: 14-Apr 18
  • 90 posts

Posted 09 July 2018 - 01:02 PM #13

Please post here full content of the call_requests_content.tpl file (use Code functionality in the WYSIWYG editor above)


<div id="{$id}">

<form name="call_requests_form{if !$product}_main{/if}" id="form_{$id}" action="{""|fn_url}" method="post" class="cm-ajax{if !$product} cm-ajax-full-render{/if}"{if $product} data-ca-product-form="product_form_{$obj_prefix}{$product.product_id}"{/if}>
<input type="hidden" name="result_ids" value="{$id}" />
<input type="hidden" name="return_url" value="{$config.current_url}" />

{if $product}
    <input type="hidden" name="call_data[product_id]" value="{$product.product_id}" />
    <div class="ty-cr-product-info-container">
        <div class="ty-cr-product-info-image">
            {include file="common/image.tpl" images=$product.main_pair image_width=$settings.Thumbnails.product_cart_thumbnail_width image_height=$settings.Thumbnails.product_cart_thumbnail_height}
        </div>
        <div class="ty-cr-product-info-header">
            <h3 class="ty-product-block-title"><bdi>{$product.product}</bdi></h3>
        </div>
    </div>
{/if}

<div class="ty-control-group">
    <label class="ty-control-group__title cm-required" for="call_data_{$id}_name">{__("your_name")}</label>
    <input id="call_data_{$id}_name" size="50" class="ty-input-text-full" type="text" name="call_data[name]" value="{$call_data.name}" />
</div>

<div class="ty-control-group">
    <label for="call_data_{$id}_phone" class="ty-control-group__title cm-required cm-cr-mask-phone-lbl{if !$product} cm-required{/if}">{__("phone")}</label>
    <input id="call_data_{$id}_phone" class="ty-input-text-full cm-cr-mask-phone ty-inputmask-bdi" size="50" type="text" name="call_data[phone]" value="{$call_data.phone}" />
</div>

{if $product}

    <div class="ty-cr-or">— {__("or")} —</div>

    <div class="ty-control-group">
        <label for="call_data_{$id}_email" class="ty-control-group__title cm-email">{__("email")}</label>
        <input id="call_data_{$id}_email" class="ty-input-text-full" size="50" type="text" name="call_data[email]" value="{$call_data.email}" />
    </div>
    
    
    <div class="cr-popup-error-box">
        <div class="hidden cm-cr-error-box help-inline">
            <p>{__("call_requests.enter_phone_or_email_text")}</p>
        </div>
    </div>

{else}

    <div class="ty-control-group">
        <label for="call_data_{$id}_convenient_time_from" class="ty-control-group__title">{__("call_requests.convenient_time")}</label>
        <bdi>
            <input id="call_data_{$id}_convenient_time_from" class="ty-input-text cm-cr-mask-time" size="6" type="text" name="call_data[time_from]" value="" placeholder="{$smarty.const.CALL_REQUESTS_DEFAULT_TIME_FROM}" /> -
            <input id="call_data_{$id}_convenient_time_to" class="ty-input-text cm-cr-mask-time" size="6" type="text" name="call_data[time_to]" value="" placeholder="{$smarty.const.CALL_REQUESTS_DEFAULT_TIME_TO}" />
        </bdi>
    </div>

{/if}

{include file="common/image_verification.tpl" option="call_request"}

<div class="buttons-container">
    {include file="buttons/button.tpl" but_name="dispatch[call_requests.request]" but_text=__("submit") but_role="submit" but_meta="ty-btn__primary ty-btn__big cm-form-dialog-closer ty-btn"}
</div>

</form>

<!--{$id}--></div>

Here is the Content of My file



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 17997 posts

Posted 10 July 2018 - 05:20 AM #14

I do not see new code here.


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • alijaved
  • Advanced Member
  • Members
  • Join Date: 14-Apr 18
  • 90 posts

Posted 10 July 2018 - 07:25 AM #15

I do not see new code here.

 

Yes because I have removed the code because it was not working, however here is the code with the new code.


<div id="{$id}">

<form name="call_requests_form{if !$product}_main{/if}" id="form_{$id}" action="{""|fn_url}" method="post" class="cm-ajax{if !$product} cm-ajax-full-render{/if}"{if $product} data-ca-product-form="product_form_{$obj_prefix}{$product.product_id}"{/if}>
<input type="hidden" name="result_ids" value="{$id}" />
<input type="hidden" name="return_url" value="{$config.current_url}" />

{if $product}
    <input type="hidden" name="call_data[product_id]" value="{$product.product_id}" />
    <div class="ty-cr-product-info-container">
        <div class="ty-cr-product-info-image">
            {include file="common/image.tpl" images=$product.main_pair image_width=$settings.Thumbnails.product_cart_thumbnail_width image_height=$settings.Thumbnails.product_cart_thumbnail_height}
        </div>
        <div class="ty-cr-product-info-header">
            <h3 class="ty-product-block-title"><bdi>{$product.product}</bdi></h3>
        </div>
    </div>
{/if}

<div class="ty-control-group">
    <label class="ty-control-group__title cm-required" for="call_data_{$id}_name">{__("your_name")}</label>
    <input id="call_data_{$id}_name" size="50" class="ty-input-text-full" type="text" name="call_data[name]" value="{$call_data.name}" />
</div>

<div class="ty-control-group">
    <label for="call_data_{$id}_phone" class="ty-control-group__title cm-required cm-cr-mask-phone-lbl{if !$product} cm-required{/if}">{__("phone")}</label>
    <input id="call_data_{$id}_phone" class="ty-input-text-full cm-cr-mask-phone ty-inputmask-bdi" size="50" type="text" name="call_data[phone]" value="{$call_data.phone}" />
</div>

{if $product}

    <div class="ty-cr-or">— {__("or")} —</div>

    <div class="ty-control-group">
        <label for="call_data_{$id}_email" class="ty-control-group__title cm-email">{__("email")}</label>
        <input id="call_data_{$id}_email" class="ty-input-text-full" size="50" type="text" name="call_data[email]" value="{$call_data.email}" />
    </div>
    
    <p>{__('shipping_rates_applied'}</p>
    
    <div class="cr-popup-error-box">
        <div class="hidden cm-cr-error-box help-inline">
            <p>{__("call_requests.enter_phone_or_email_text")}</p>
        </div>
    </div>

{else}

    <div class="ty-control-group">
        <label for="call_data_{$id}_convenient_time_from" class="ty-control-group__title">{__("call_requests.convenient_time")}</label>
        <bdi>
            <input id="call_data_{$id}_convenient_time_from" class="ty-input-text cm-cr-mask-time" size="6" type="text" name="call_data[time_from]" value="" placeholder="{$smarty.const.CALL_REQUESTS_DEFAULT_TIME_FROM}" /> -
            <input id="call_data_{$id}_convenient_time_to" class="ty-input-text cm-cr-mask-time" size="6" type="text" name="call_data[time_to]" value="" placeholder="{$smarty.const.CALL_REQUESTS_DEFAULT_TIME_TO}" />
        </bdi>
    </div>

{/if}

{include file="common/image_verification.tpl" option="call_request"}

<div class="buttons-container">
    {include file="buttons/button.tpl" but_name="dispatch[call_requests.request]" but_text=__("submit") but_role="submit" but_meta="ty-btn__primary ty-btn__big cm-form-dialog-closer ty-btn"}
</div>

</form>

<!--{$id}--></div>

Please provide me the solution 



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 17997 posts

Posted 10 July 2018 - 12:35 PM #16

Sorry, I missed bracket in my code. Correct code is

<p>{__('shipping_rates_applied')}</p>

GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • alijaved
  • Advanced Member
  • Members
  • Join Date: 14-Apr 18
  • 90 posts

Posted 10 July 2018 - 02:46 PM #17

 

Sorry, I missed bracket in my code. Correct code is

<p>{__('shipping_rates_applied')}</p>

 

 

worked like a charm :-) <3 Can you tell me How can I hide E-mail field from the same pop-up screen?



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 17997 posts

Posted 11 July 2018 - 05:32 AM #18

Just replace

    <div class="ty-cr-or">— {__("or")} —</div>

    <div class="ty-control-group">
        <label for="call_data_{$id}_email" class="ty-control-group__title cm-email">{__("email")}</label>
        <input id="call_data_{$id}_email" class="ty-input-text-full" size="50" type="text" name="call_data[email]" value="{$call_data.email}" />
    </div>

with

{*
    <div class="ty-cr-or">— {__("or")} —</div>

    <div class="ty-control-group">
        <label for="call_data_{$id}_email" class="ty-control-group__title cm-email">{__("email")}</label>
        <input id="call_data_{$id}_email" class="ty-input-text-full" size="50" type="text" name="call_data[email]" value="{$call_data.email}" />
    </div>
*}

GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • alijaved
  • Advanced Member
  • Members
  • Join Date: 14-Apr 18
  • 90 posts

Posted 11 July 2018 - 01:15 PM #19

Thanks for your reply eComlabs, Can we add a confirmation step on this pop-up? because a lot of my customers are confused. They order with Buy now with 1 click and they also make the same order by Cash on delivery So I just want to know is there a way that I can add a confirmation step or checkbox that says Confirm order?



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 17997 posts

Posted 12 July 2018 - 05:47 AM #20

Yes, you can the code should be similar to

    <div class="ty-control-group">
        <label for="call_data_{$id}_confirm" class="cm-required ty-control-group__title">{__("confirm_order")}</label>
        <input id="call_data_{$id}_confirm" type="checkbox" name="call_data[confirm_order]" value="Y" />
    </div>

(!) Not tested + value will not be saved in database


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.