Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integração do Banner E-bit #3

Open
luisantcosta opened this issue Apr 4, 2018 · 0 comments
Open

Integração do Banner E-bit #3

luisantcosta opened this issue Apr 4, 2018 · 0 comments

Comments

@luisantcosta
Copy link

Prezados achei o seguinte código a ser adicionado no Functions.php para add o banner do E-Bit no woocommerce:

?php
add_action( 'woocommerce_thankyou', 'ebit_banner' );

function ebit_banner( $order_id ) {

$store_id = ''; // o ID da sua loja
$buscape_id = ''; // o ID único do Buscapé

$order = wc_get_order( $order_id );
$order_items = $order->get_items();

foreach ( $order_items as $item ) {
$product = wc_get_product( $item['product_id'] );
$product_name[] = $product->get_title();
$sku[] = $product->get_sku();
$qty[] = $item['qty'];
$total[] = $item['line_total'];
}

$email = $order->billing_email;
$totalSpent = $order->get_total();
$deliveryTax = $order->get_shipping_tax();
$value = implode( '|', $total );
$quantity = implode( '|', $qty );
$productName = implode( '|', $product_name );
$sku = implode("|", $sku);

echo '';

echo '';
echo 'https://imgs.ebit.com.br/ebitBR/selo-ebit/js/getSelo.js?'%20.%20$store_id%20.%20'&lightbox=true';

}

Porem não funciona, alguem consegue ajudar?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant