• Resolved banderasdelmundo

    (@banderasdelmundo)


    cuando estoy configurando los productos con variantes desde WooCommerce, a la hora de ver el resultado como prueba dentro de mi panel de wordpress se ve todo perfecto, pero después de guardar todo entro por el móvil o por otro navegador en el pc de sobremesa en mi pagina e introduzco las variantes elegidas y al final de elegir todas las variantes tendría que salir el precio de cada una pero no sale ningún precio, y le doy a guardar en el carrito y me sale un banner que dice. ” POR FAVOR ELIJE LAS OPCIONES DEL PRODUCTO VISITANDO BANDERA DE ESPA?A” pero las variantes ya están introducidas

    y tampoco se ve el botón de scroll up, pero esto es menos importante

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Irshad Ahmad

    (@irshadahmad21)

    Hello,

    Prices of variable products are not sent by the plugin.

    It needs some custom code.

    Thread Starter banderasdelmundo

    (@banderasdelmundo)

    yo he puesto en el SKU para cada producto un nombre personalizado

    Thread Starter banderasdelmundo

    (@banderasdelmundo)

    y cada variante tiene su SKU personalizado y el precio personalizado, cuando lo pruebo dentro del entorno de wordpress todo funciona bien, se ve todo correcto cada variante con su precio y los detalles pero al salir del entorno de wordpress es cuando surge el problema

    Plugin Author Irshad Ahmad

    (@irshadahmad21)

    Here is a code snippet to send the price of the first variation

    /* WP Telegram - Send variation price */
    add_filter( 'wptelegram_p2tg_post_data_field_value', 'wptelegram_modify_wc_price_for_variations', 10, 3 );
    function wptelegram_modify_wc_price_for_variations( $value, $field, $post ) {
      // If the post type is 'product' and we the field is regular or sale price
      if ( 'product' === $post->post_type && preg_match( '/^(?:cf:_|wc:)(?:regular|sale)_price$/iu', $field ) ) {
    
        $product = wc_get_product( $post->ID );
    
        // Ensure that the product is valid and variable
        if ( $product instanceof WC_Product && $product->is_type( 'variable' ) ) {
    
          // get all product variations
          $variations = $product->get_available_variations();
    
          if ( ! empty( $variations ) ) {
            // first variation ID
            $variation_id = $variations[0]['variation_id'];
     
            $variable_product = new WC_Product_Variation( $variation_id );
    
            // Convert 'cf:_regular_price' to 'get_regular_price'
            $method = 'get' . str_replace( ['cf:_', 'wc:'], '_', $field );
    
            return call_user_func( [ $variable_product, $method] );
          }
        }
      }
      return $value;
    }
    /* WP Telegram - Send variation price */
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘no se ven los precios de los productos’ is closed to new replies.