php – How to display a woocomerce group product correctly?

I am building a Woocomerce site with the GIOIA theme and it contains a grouped product named “Ensemble Wendy”.
As far as I know, grouped product in Woocomerce should be displayed like this : it lets you choose all the options for the childs products and lets you add them to the cart in the same page.

Unexpectidely, mine looks like this: it shows buttons witch links to the child products’ individual pages with no option to add anything to the cart.

I have checked Woocomerce’s official documentation for grouped products and apparently I don’t thing I have done anything different from what’s in the tutorial so I am confused.

I searched in Woocomerce’s settings as well as in the theme’s setting but I didn’t find anything who could correct the problem.

I searched for solutions online and I found a plugin called WPC grouped product which normaly should give the result that I want but I get this instead: the child products are displayed but there is no place where I can choose the variations for the products and this prevents me to add them to the cart. I inspected the page with the Inspector though, and there seems to be a select element there but it’s hidden. I’ve searched everywhere in the settings if I could find anything to correct that without success so I decided to force everything by just overriding the css with a custom code :

.woosg-products .woosg-product form.variations_form .variations .variation .select select {
    display: block !important;
}

And then, it displays the result I was looking for and finally allows me to add something to the cart.

Now the problem is that, after I select some options and Add them to the cart, the grouped product seems to be successfully added but it hasn’t retained the price or any other information about the product : Here is a screenshoot.

Maybe there is a way to correct through code but I am still not good enough to touch a theme’s code source yet.

I’ve looked everywhere if anyone had a similar problem but I didn’t find anything helpful.

Thanks for anyone who would help me.

Accept orders in Woocomerce without payment [closed]

I am trying to accept orders without any sort of payment, just get the email and the list of requested items. How is this possible to achieve?

php – Woocomerce añadir dirección de envío a productos virtuales

En un cliente tengo que realizar una promoción de Woocomerce para que los productos no tengan gastos de envio. Debido a que ya hay un plugin que gestiona los envios con otra promoción de “gratis para pedidos de más de 60€”, no me deja aplicar otro envio gratuito especifico para esta promoción que tiene su propia landing page ( cosas de la gente de marketing), el caso es que al marcar los productos como virtuales no se aplica ningún gasto de envío que es lo que yo buscaba pero el problema surge cuando se mandan los detalles del pedido en los emails de notificación. No aparece la dirección de envio.
He solucionado esta primera parte con el siguiente codigo:

/*Add shipping to virtual order*/
add_filter( 'woocommerce_cart_needs_shipping_address', '__return_true', 50 );

Con esto consigo que en el checkout aparezca la opción de enviar a una dirección diferente (aparte de la dirección de facturación que sale por defecto), la dirección de envío aparece en woocomerce order details correctamente pero no se envía en los emails de notificación.
Esta es la plantilla de PHP que he copiado en mi tema hijo en:

woocommerce/templates/email/email-addresses.php

Tiene el siguiente codigo:

<?php
/**
 * Email Addresses
 *
 * This template can be overridden by copying it to yourtheme/woocommerce/emails/email-addresses.php.
 *
 * HOWEVER, on occasion WooCommerce will need to update template files and you
 * (the theme developer) will need to copy the new files to your theme to
 * maintain compatibility. We try to do this as little as possible, but it does
 * happen. When this occurs the version of the template file will be bumped and
 * the readme will list any important changes.
 *
 * @see https://docs.woocommerce.com/document/template-structure/
 * @package WooCommerceTemplatesEmails
 * @version 3.9.0
 */

if ( ! defined( 'ABSPATH' ) ) {
    exit;
}

$text_align = is_rtl() ? 'right' : 'left';
$address    = $order->get_formatted_billing_address();
$shipping   = $order->get_formatted_shipping_address();

?><table id="addresses" cellspacing="0" cellpadding="0" style="width: 100%; vertical-align: top; margin-bottom: 40px; padding:0;" border="0">
    <tr>
        <td style="text-align:<?php echo esc_attr( $text_align ); ?>; font-family: 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif; border:0; padding:0;" valign="top" width="50%">
            <h2><?php esc_html_e( 'Billing address', 'woocommerce' ); ?></h2>

            <address class="address">
                <?php echo wp_kses_post( $address ? $address : esc_html__( 'N/A', 'woocommerce' ) ); ?>
                <?php if ( $order->get_billing_phone() ) : ?>
                    <br/><?php echo wc_make_phone_clickable( $order->get_billing_phone() ); ?>
                <?php endif; ?>
                <?php if ( $order->get_billing_email() ) : ?>
                    <br/><?php echo esc_html( $order->get_billing_email() ); ?>
                <?php endif; ?>
            </address>
        </td>
        <?php if ( ! wc_ship_to_billing_address_only() && $order->needs_shipping_address() && $shipping ) : ?>
            <td style="text-align:<?php echo esc_attr( $text_align ); ?>; font-family: 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif; padding:0;" valign="top" width="50%">
                <h2><?php esc_html_e( 'Shipping address', 'woocommerce' ); ?></h2>

                <address class="address"><?php echo wp_kses_post( $shipping ); ?></address>
            </td>
        <?php endif; ?>
    </tr>
</table>

Creo que la clave está en esta linea:

if ( ! wc_ship_to_billing_address_only() && $order->needs_shipping_address() && $shipping ) :

Podéis indicarme qué tengo que poner para que salga la dirección de envío en las notificaciones de email?

Muchas gracias

woocommerce – Trying to run a add_action within a function to run a woocomerce function on a ajax request

I am able to get a ajax request to work properly on a woocommerce checkout form page, now I want to update the price of the checkout in that ajax request. My add_action is in the function that is fired by the ajax request.

This is all done in a custom plugin as well

Here is my code this far, it doesn’t seem like the function request_gift_card ever fires


function gift_card_redeem(){
  
  if(!empty($_SERVER('HTTP_X_REQUESTED_WITH')) && strtolower($_SERVER('HTTP_X_REQUESTED_WITH')) == 'xmlhttprequest') {
    error_log("test !empty");
    
add_action( 'woocommerce_review_order_before_order_total', 'custom_cart_total' );
add_action( 'woocommerce_before_cart_totals', 'custom_cart_total' );
function custom_cart_total() {

    if ( is_admin() && ! defined( 'DOING_AJAX' ) )
            return;

    WC()->cart->total *= 0.25;
    //var_dump( WC()->cart->total);
}

    $result('type') = "success";
    $result = json_encode($result);
    echo $result;
  }
  else {
    error_log("test else");
      header("Location: ".$_SERVER("HTTP_REFERER"));
  }

  die();
}

I can get this to work if I place it outside the gift_card_redeem function but I need it to run after the ajax request

add_action( 'woocommerce_review_order_before_order_total', 'custom_cart_total' );
add_action( 'woocommerce_before_cart_totals', 'custom_cart_total' );
function custom_cart_total() {

    if ( is_admin() && ! defined( 'DOING_AJAX' ) )
            return;

    WC()->cart->total *= 0.25;
    //var_dump( WC()->cart->total);
}

php – Duda parametros API woocomerce

estoy realizando un php en una consulta al APi de woocomerce, necesito traer todos los productos y lo estoy realizando con esta opción.

$products = $woocommerce->get('products');

pero al validar el array solo me trae los 10 primeros productos y son 200.

leyendo en la documentación del API hay un paramentro (per_page).

y se lo estoy enviando de la siguiente forma desde el php

$woocommerce = new Client(
    'https://mirutaweb.com/',
    'ck_XXXXX',
    'cs_XXXXX',
    (
        'wp_api' => true,
        'version' => 'wc/v3',
        'per_page'=> 200,
        'query_string_auth' => true
    )
);

pero al validar el array aun me sigue mostrando los mismo 10.

Hay alguna otra forma de realizar este proceso? o estoy realizando el proceso incorrectamente?

realizando la prueba desde el postman si me arroja los resultado completos.

https://mirutaweb.com/wp-json/wc/v3/products?per_page=200&consumer_key=ck_xxxx&consumer_secret=cs_xxxxxx

Some terms on the search box of Woocomerce redirects to wp-admin

I bought the Shopinia theme by Themeforest last month. I’d like to ensure that the problem isn’t related to the theme.

When I try to search x terms on the search box of my webpage (https://productoespaña.es) for some reason it redirects to wp-admin (if you’re a guest it will redirects to wp-login.php).

An example of a failing term is “Vegana”.

Could you give me some advice in order to check what’s failing? Because I couldn’t figure it by myself and by searching on Google I don’t see any reference to this. So I’m a little bit lost.

Did anyone have this problem before?

I already sent a ticket to Themforst in order to guide me. But I suppose that this could be caused because of a bug on the Woocomerce plugin?

EDIT

I executed the curl -I xxx command in order to see if there was any 300 http code… But this is returned:

usuario@DESKTOP-8FVL506:~$ curl -I
https://xn--productoespaa-tkb.es/?s=vegana&post_type=product (1) 90
usuario@DESKTOP-8FVL506:~$ HTTP/1.1 200 OK Date: Tue, 18 Aug 2020
00:37:18 GMT Server: Apache/2.4.38 (Debian) Link:
https://productoespaña.es/index.php?rest_route=/;
rel=”https://api.w.org/” Content-Type: text/html; charset=UTF-8

woocommerce – wordpress woocomerce subscriptions and Membership error

I am adding the custom code in the function create_subscription ()

here is the code which gives the error ,,,I have mentioned in comments which line gives the error

$renewal = wcs_order_contains_renewal($parent_order->get_id());
        if ($renewal == false) {
            if ($trial_length > 0) {
                $dates = array(
                    'trial_end' => $next_payment,
                    'next_payment' => $next_payment,
                );
                try {
                    $subscription->update_dates($dates); //this code line gives the error it works fine if I comment this line
                } catch (Exception $e) {
                    f24_write_data_to_file('Error in updating Trial end date ');
                    f24_write_data_to_file($dates);
                }

            }
        }
        WC_Subscriptions_Manager::activate_subscriptions_for_order($parent_order);

        $this->subscription = $subscription;

        // On order created.
        do_action('paywall/wc_subscription_created', $subscription);

        return $subscription;

and here is the error which I got ,,, I am using the woocommerce subscriptions plugin and Woocommerce Membership Plugin, Need help now, how to fix the error while updating the trial_end date?

enter image description here

plugins – WordPress Woocomerce Issue

Notice: post was called incorrectly. Product properties should not be accessed directly. Backtrace: require(‘wp-blog-header.php’), require_once(‘wp-includes/template-loader.php’), include(‘/themes/goodstore/woocommerce.php’), get_template_part, locate_template, load_template, require(‘/themes/goodstore/loop-products.php’), wc_get_template_part, load_template, require(‘/themes/goodstore/content-product.php’), jaw_get_template_part, locate_template, load_template, require(‘/themes/goodstore/templates/woocommerce/content-product-0.php’), do_action(‘woocommerce_after_shop_loop_item_title’), WP_Hook->do_action, WP_Hook->apply_filters, call_user_func_array, wc_add_long_custom_description, WC_Abstract_Legacy_Product->__get, wc_doing_it_wrong Please see Debugging in WordPress for more information. (This message was added in version 3.0.) in /var/www/aurora/dealers/PPPP-2/PPPP-CART/wp-includes/functions.php on line 4201

I updated plugin by mistake. I am getting this error.

Anybody can help?

Thank you

Add filter tabs of woocomerce category in a product slider

I would like to display a product category filter in a product slider as shown in the image to change products by clicking on those filters. Can anyone tell me if there is a complement or other solution to achieve this?

Thanks in advance

How to display only part of the product name on the category page – WordPress with woocomerce

I want to show only part of the product name on my website, but show only the full name on the product page, Checkou, Cart and Invoice, like this:

enter the description of the image here

Can anyone help me?