scrimmy
Forum Replies Created
Viewing 4 replies - 1 through 4 (of 4 total)
-
Hi @abidhasan112,
Thank you for the prompt solution of the problem, at the moment there is no way to check how it works. Thank you for trying to solve such problems!
@abidhasan112, thanks for the clarification!
Hi @abidhasan112,
After activating your plugin, I spontaneously get one (attached a link):
1. Propaganda itself https://prnt.sc/r5VhyK0_HRK-
2. The file in which an element with propaganda content is created (located on the way) – templately\assets\js\templately.js (attached a link)
https://prnt.sc/y8yFAvcpJcnTForum: Plugins
In reply to: [Tinkoff Credit for WooCommerce] Не удается получить доступ к сайтуРебзя, кому интересно, можете юзать моё временное решение.
В functions.php добавляем:add_action('wp_footer', function(){ ?> <script src="https://forma.tinkoff.ru/static/onlineScript.js"></script> <?php });
Затем добавляем:
add_action('woocommerce_review_order_after_submit', 'tinkoff_modal_form'); function tinkoff_modal_form() { global $woocommerce; $items = $woocommerce->cart->get_cart(); $items_list = array(); foreach ($items as $item) { $item_data = array( 'name' => "'" . $item['data']->get_name() . "'", 'price' => $item['data']->get_price(), 'quantity' => $item['quantity'] ); $item_json = json_encode($item_data, JSON_UNESCAPED_UNICODE); array_push($items_list, $item_json); } ?> <button type="button" class="TINKOFF_BTN_YELLOW" onclick="tinkoff.create( { sum: '<?php echo $woocommerce->cart->subtotal ?>', items: <?php echo '[' . str_replace('"', '', implode(',', $items_list)) . ']'; ?>, shopId: 'SHOP_ID', showcaseId: 'SHOWCASE_ID', }, {view: 'modal'})">Купить в кредит</button> <?php }
Не забудьте поменять shopId и showcaseId на свои
Viewing 4 replies - 1 through 4 (of 4 total)