• Resolved ricardoiacono

    (@ricardoiacono)


    Hola Equipo , queria consultarles como solucionar el peque?o inconveniente que tengo:

    Ejecuto el plugin por medio del shortcode desde el function.php

    “add_action( ‘woocommerce_simple_add_to_cart’,’shortcode_boton’,50);

    function shortcode_boton(){
    echo do_shortcode(‘[vc_row][vc_column width=”1/3″][porto_info_box icon_type=”simpleline” icon_size=”45″ icon_border_radius=”500″ title=”Pagá en cuotas” subtitle=”Con todos los medios de pago” read_more=”box” icon_simpleline=”Simple-Line-Icons-credit-card” icon_color=”#dd0000″ title_font_porto_typography=”{family:Poppins,variant:600,font_size:18,line_height:,letter_spacing:</code>,text_transform:none}" css_info_box=".vc_custom_1660885259810{padding-top: 10px !important;}"][/porto_info_box][/vc_column][vc_column width="1/3"][porto_info_box icon_type="porto" icon_size="45" icon_border_radius="500" title="Retirá gratis" subtitle="Buscá la sucursal más cercana" read_more="box" icon_color="#dd0000" icon_porto="porto-icon-fazer-compras" css_info_box=".vc_custom_1660885267595{padding-top: 10px !important;}" title_font_porto_typography="{family:Poppins,variant:600,font_size:18,line_height:,letter_spacing:</code>,text_transform:none}"][/porto_info_box][/vc_column][vc_column width="1/3"][porto_info_box icon_type="porto" icon_size="45" icon_border_radius="500" title="Calculá tu envío" subtitle="Ingresá tu código postal" read_more="box" icon_color="#dd0000" icon_porto="porto-icon-shipping" css_info_box=".vc_custom_1660885274731{padding-top: 15px !important;}" title_font_porto_typography="{family:Poppins,variant:600,font_size:18,line_height:,letter_spacing:</code>,text_transform:none}"][/porto_info_box][/vc_column][/vc_row][vc_row][vc_column][vc_raw_html]JTVCcGlfYWRkcmVzc19mb3JtJTVE[/vc_raw_html][/vc_column][/vc_row]');}"

    Pero cuando hago click en "Uddate Address" el resultado me lo muestra en una pagina en blanco

    "{"success":true,"data":"<div class=\"pi-address-form-success\">Ofrecemos envíos a su ubicación<ul class=\"pisol-ppscw-shipping-method-list\ "><li>Retirar por OCA - Sucursal OCA - Villa Gesell - Buenos Aires 731, Villa Gesell, disponible el martes: <span class=\"woocommerce-Precio-cantidad\"><bdi><span class=\" woocommerce-Price-currencySymbol\">$<\/span>2.173,00<\/bdi><\/span><\/li><li>Entrega OCA a domicilio, llega el 06 de septiembre: < span class=\"woocommerce-Precio-cantidad\"><bdi><span class=\"woocommerce-Precio-monedaSímbolo\">$<\/span>2.550,00<\/bdi><\ /span><\/li><\/ul><\/div>"}"

Viewing 15 replies - 1 through 15 (of 17 total)
  • Thread Starter ricardoiacono

    (@ricardoiacono)

    Buen dia estimado.

    Necesita algún tipo de información extra para poder evaluar el inconveniente anteriormente descripto ?

    Quedo a la espera de sus comentarios

    Gracias
    Ricardo Iacono

    Plugin Author rajeshsingh520

    (@rajeshsingh520)

    Sorry we are not understanding your language please write it in English

    Thread Starter ricardoiacono

    (@ricardoiacono)

    okay. I told you before
    How to solve the small inconvenience that I have:

    Run the plugin via the shortcode from the function.php

    add_action( 'woocommerce_simple_add_to_cart','shortcode_boton',50);
    
    function shortcode_boton(){
    	echo do_shortcode('[vc_row][vc_column width="1/3"][porto_info_box icon_type="simpleline" icon_size="45" icon_border_radius="500" title="Pagá en cuotas" subtitle="Con todos los medios de pago" read_more="box" icon_simpleline="Simple-Line-Icons-credit-card" icon_color="#dd0000" title_font_porto_typography="{<code></code>family<code></code>:<code></code>Poppins<code></code>,<code></code>variant<code></code>:<code></code>600<code></code>,<code></code>font_size<code></code>:<code></code>18<code></code>,<code></code>line_height<code></code>:<code><code>,</code><code>letter_spacing</code><code>:</code></code>,<code></code>text_transform<code></code>:<code></code>none<code></code>}" css_info_box=".vc_custom_1660885259810{padding-top: 10px !important;}"][/porto_info_box][/vc_column][vc_column width="1/3"][porto_info_box icon_type="porto" icon_size="45" icon_border_radius="500" title="Retirá gratis" subtitle="Buscá la sucursal más cercana" read_more="box" icon_color="#dd0000" icon_porto="porto-icon-fazer-compras" css_info_box=".vc_custom_1660885267595{padding-top: 10px !important;}" title_font_porto_typography="{<code></code>family<code></code>:<code></code>Poppins<code></code>,<code></code>variant<code></code>:<code></code>600<code></code>,<code></code>font_size<code></code>:<code></code>18<code></code>,<code></code>line_height<code></code>:<code><code>,</code><code>letter_spacing</code><code>:</code></code>,<code></code>text_transform<code></code>:<code></code>none<code></code>}"][/porto_info_box][/vc_column][vc_column width="1/3"][porto_info_box icon_type="porto" icon_size="45" icon_border_radius="500" title="Calculá tu envío" subtitle="Ingresá tu código postal" read_more="box" icon_color="#dd0000" icon_porto="porto-icon-shipping" css_info_box=".vc_custom_1660885274731{padding-top: 15px !important;}" title_font_porto_typography="{<code></code>family<code></code>:<code></code>Poppins<code></code>,<code></code>variant<code></code>:<code></code>600<code></code>,<code></code>font_size<code></code>:<code></code>18<code></code>,<code></code>line_height<code></code>:<code><code>,</code><code>letter_spacing</code><code>:</code></code>,<code></code>text_transform<code></code>:<code></code>none<code></code>}"][/porto_info_box][/vc_column][/vc_row][vc_row][vc_column][vc_raw_html]JTVCcGlfYWRkcmVzc19mb3JtJTVE[/vc_raw_html][/vc_column][/vc_row]');}

    But when I click on “Update address” the result shows me on a blank page

    https://www.iacono.com.ar/wp-admin/admin-ajax.php?v=5b61a1b298a0

    {"success":true,"data":"<div class=\"pi-address-form-success\">Ofrecemos envíos a su ubicación<ul class=\"pisol-ppscw-shipping-method-list\ "><li>Retirar por OCA - Sucursal OCA - Villa Gesell - Buenos Aires 731, Villa Gesell, disponible el lunes: <span class=\"woocommerce-Precio-cantidad\"><bdi><span class=\" woocommerce-Price-currencySymbol\">$<\/span>2.173,00<\/bdi><\/span><\/li><li>Entrega OCA a domicilio, llega el 12 de septiembre: < span class=\"woocommerce-Precio-cantidad\"><bdi><span class=\"woocommerce-Precio-monedaSímbolo\">$<\/span>2.550,00<\/bdi><\ /span><\/li><\/ul><\/div>"}

    Plugin Author rajeshsingh520

    (@rajeshsingh520)

    sorry but your JS must be braking that’s why instead of making ajax request in background it is directly openings the ajax link

    since this is your custom code we can’t reproduce the issue on our end and we can’t say what can be causing the issue

    Thread Starter ricardoiacono

    (@ricardoiacono)

    Thread Starter ricardoiacono

    (@ricardoiacono)

    Thread Starter ricardoiacono

    (@ricardoiacono)

    ok, but if I write it directly. only with the shortcode the result is the same
    I want to use it in a popup and it generated the error. That’s why I tried directly and the same generates it

    add_action( 'woocommerce_simple_add_to_cart','shortcode_boton',50);
    
    function shortcode_boton(){
    echo do_shortcode('[pi_address_form]');}

    {"success":true,"data":"<div class=\"pi-address-form-success\">Ofrecemos envíos a su ubicación<ul class=\"pisol-ppscw-shipping-method-list\ "><li>Retirar por OCA - Sucursal OCA - Villa Gesell - Buenos Aires 731, Villa Gesell, disponible el lunes: <span class=\"woocommerce-Precio-cantidad\"><bdi><span class=\" woocommerce-Price-currencySymbol\">$<\/span>2.173,00<\/bdi><\/span><\/li><li>Entrega OCA a domicilio, llega el 12 de septiembre: < span class=\"woocommerce-Precio-cantidad\"><bdi><span class=\"woocommerce-Precio-monedaSímbolo\">$<\/span>2.550,00<\/bdi><\ /span><\/li><\/ul><\/div>"}

    Thread Starter ricardoiacono

    (@ricardoiacono)

    Thread Starter ricardoiacono

    (@ricardoiacono)

    Plugin Author rajeshsingh520

    (@rajeshsingh520)

    we have a JS to detect the form submission and then do the AJAX

    but in your page the JS file is not loading you need this JS file “address-form.js”

    product-page-shipping-calculator-woocommerce/public/js/address-form.js (this file is missing in your site )

    This file get loaded when this option is enabled
    Popup Tab > Enable delivery location in popup

    Thread Starter ricardoiacono

    (@ricardoiacono)

    Thread Starter ricardoiacono

    (@ricardoiacono)

    What enables the popup? I had tried it before writing to him and the result was the same

    {"success":true,"data":"<div class=\"pi-address-form-success\">Ofrecemos envíos a su ubicación<ul class=\"pisol-ppscw-shipping-method-list\ "><li>Retirar por OCA - Sucursal OCA - Cordoba (Cor) - La Rioja 1142, Cordoba, disponible el 06 de septiembre: <span class=\"woocommerce-Precio-cantidad\"><bdi><span class =\"woocommerce-Price-currencySymbol\">$<\/span>4.252,00<\/bdi><\/span><\/li><li>Retirar por OCA - Sucursal OCA - Córdoba ( Coa) - Juan B. Justo 5278, Córdoba, disponible el 06 de septiembre: <span class=\"woocommerce-Price-amount cantidad\"><bdi><span class=\"woocommerce-Price-currencySymbol\">& #36;<\/span>4.252,00<\/bdi><\/span><\/li><li>Retirar por OCA - Sucursal OCA - Villa Carlos Paz - Uruguay 108, Villa Carlos Paz, disponible el 06 de septiembre: <span class=\"woocommerce-Precio-cantidad\"><bdi><span class=\ "woocommerce-Price-currencySymbol\">$<\/span>4.252,00<\/bdi><\/span><\/li><li>Entrega OCA a domicilio, llega el 06 de septiembre: <span class=\"woocommerce-Precio-cantidad\"><bdi><span class=\"woocommerce-Precio-currencySymbol\">$<\/span>4.508,00<\/bdi>< \/span><\/li><\/ul><\/div>"}woocommerce-Price-currencySymbol\">$<\/span>4.252,00<\/bdi><\/span><\/li><li>Entrega OCA a domicilio, llega el 06 de septiembre: < span class=\"woocommerce-Precio-cantidad\"><bdi><span class=\"woocommerce-Precio-monedaSímbolo\">$<\/span>4.508,00<\/bdi><\ /span><\/li><\/ul><\/div>"}woocommerce-Price-currencySymbol\">$<\/span>4.252,00<\/bdi><\/span><\/li><li>Entrega OCA a domicilio, llega el 06 de septiembre: < span class=\"woocommerce-Precio-cantidad\"><bdi><span class=\"woocommerce-Precio-monedaSímbolo\">$<\/span>4.508,00<\/bdi><\ /span><\/li><\/ul><\/div>"}

    Plugin Author rajeshsingh520

    (@rajeshsingh520)

    Ok when you are enabling this option

    our plugin is inserting the form on its own as per its normal behaviour

    so there is one <form> element added by our plugin and one <form> element is been added by your shortcode

    so when you click the submit button in your shortcode form the JS do not run as there are 2 similar form element

    => Sorry your shortcode will not work as there will be one extra form added by our plugin

    View post on imgur.com

    so you will have to use it normally not in shortcode

    Plugin Author rajeshsingh520

    (@rajeshsingh520)

    => Important point

    The shortcode that you are adding is getting added inside the product add to cart form

    so it is creating a loop of form

    
    <form> => Product add to cart form
       <form> => Shortcode form html do not allow looping of form element
    
       </form>
    </form>
    

    you need to remove the shortcode form out of the product form

    Thread Starter ricardoiacono

    (@ricardoiacono)

    Let me see if I understand: you are telling me that it doesn’t work because the plugin is double?

    If so, I must clarify that before inserting the shortcode I proceeded to remove it in function.php

    remove_action(‘woocommerce_after_add_to_cart_form’,’pisol_ppscw_product_page_calculator::calculator’,10);

Viewing 15 replies - 1 through 15 (of 17 total)
  • The topic ‘Uso del shorcode’ is closed to new replies.