Skip to content

Instantly share code, notes, and snippets.

//Для простых товаров поля и сохранение
function wc_uahprice_product_field() {
woocommerce_wp_text_input( array( 'id' => '_uah_price', 'class' => 'wc_input_price short', 'label' => __( 'UAH', 'woocommerce' ) ) );
woocommerce_wp_text_input( array( 'id' => '_usd_price', 'class' => 'wc_input_price short', 'label' => __( 'USD', 'woocommerce' ) ) );
woocommerce_wp_text_input( array( 'id' => '_euro_price', 'class' => 'wc_input_price short', 'label' => __( 'EUR', 'woocommerce' ) ) );
}
add_action( 'woocommerce_product_options_pricing', 'wc_uahprice_product_field' );
function wc_myprice_save_product( $product_id ) {
@Katia-Kovtun
Katia-Kovtun / readme.txt
Last active January 3, 2024 16:44
Yandex Metrika для Opencart 2.3
Также необходимо внести правки в catalog/view/javascript/common.js
найти функцию cart.add
после if (json['success']) {
добавить sendYandexEcommerce(json, "add");
найти функцию cart.remove после success: function(json) {
добавить sendYandexEcommerce(json, "remove");