php在shopkeeper主题中为xlwoocommercesalestrigger插件更改woocommerce单一产品位置(代码片段)

author author     2022-12-12     552

关键词:

/**
 * Add This whole code in working theme functions.php inside php tag to alter woocommerce native positions
 * Theme: https://themeforest.net/item/shopkeeper-ecommerce-wp-theme-for-woocommerce/9553045
 * XL WooCommerce Sales Trigger Class Instance
 */
add_action('wp', 'shokeeper_wcst_modify_positions', 99);

function shokeeper_wcst_modify_positions() 
    if (class_exists('WCST_Core')) 
        $wcst_plugin_instance = WCST_Core::get_instance();

        // removing duplicate price
        remove_action('woocommerce_single_product_summary', 'woocommerce_template_single_price', 10);

        // removing below price and below add to cart buttton action hook of plugin    
        remove_action('woocommerce_single_product_summary', array($wcst_plugin_instance, 'wcst_position_above_title'), 2.2);
        remove_action('woocommerce_single_product_summary', array($wcst_plugin_instance, 'wcst_position_below_title'), 9.2);
        remove_action('woocommerce_single_product_summary', array($wcst_plugin_instance, 'wcst_position_below_review'), 11);
        remove_action('woocommerce_single_product_summary', array($wcst_plugin_instance, 'wcst_position_below_price'), 17.2);
        remove_action('woocommerce_single_product_summary', array($wcst_plugin_instance, 'wcst_position_below_short_desc'), 21.2);
        remove_action('woocommerce_single_product_summary', array($wcst_plugin_instance, 'wcst_position_below_add_cart'), 39.2);
        remove_action('woocommerce_single_product_summary', array($wcst_plugin_instance, 'wcst_position_below_meta'), 41.2);
        remove_action('woocommerce_after_single_product_summary', array($wcst_plugin_instance, 'wcst_position_above_tab_area'), 9.8);
        remove_action('woocommerce_after_single_product_summary', array($wcst_plugin_instance, 'wcst_position_above_upsell'), 14.2);
        remove_action('woocommerce_after_single_product_summary', array($wcst_plugin_instance, 'wcst_position_below_upsell'), 19.2);
        remove_action('woocommerce_after_single_product_summary', array($wcst_plugin_instance, 'wcst_position_below_related_products'), 21.2);

        // hooking below functions for 'shopkeeper' theme
        add_action('woocommerce_single_product_summary_single_title', array($wcst_plugin_instance, 'wcst_position_above_title'), 1);
        add_action('woocommerce_single_product_summary_single_title', array($wcst_plugin_instance, 'wcst_position_below_title'), 9);
        add_action('woocommerce_single_product_summary_single_title', array($wcst_plugin_instance, 'wcst_position_below_review'), 11);
        add_action('woocommerce_single_product_summary_single_price', array($wcst_plugin_instance, 'wcst_position_below_price'), 19);
        add_action('woocommerce_single_product_summary_single_excerpt', array($wcst_plugin_instance, 'wcst_position_below_short_desc'), 21);
        add_action('woocommerce_single_product_summary_single_add_to_cart', array($wcst_plugin_instance, 'wcst_position_below_add_cart'), 31);
        add_action('woocommerce_single_product_summary_single_meta', array($wcst_plugin_instance, 'wcst_position_below_meta'), 41);
        add_action('woocommerce_after_single_product_summary_data_tabs', array($wcst_plugin_instance, 'wcst_position_above_tab_area'), 10);
        add_action('woocommerce_after_single_product_summary_related_products', array($wcst_plugin_instance, 'wcst_position_below_related_products'), 21);
    

在 ReactiveX 中为另一个主题创建计算主题

】在ReactiveX中为另一个主题创建计算主题【英文标题】:CreateacomputedSubjectforanotherSubjectinReactiveX【发布时间】:2021-05-2712:55:35【问题描述】:RX中的Subject可以存储价值并被其他人订阅。我可以知道是否有办法使Subject依赖于另一个... 查看详情

如何在 VSCode 用户设置中为深色和浅色主题指定颜色

】如何在VSCode用户设置中为深色和浅色主题指定颜色【英文标题】:HowtospecifycolourfordarkandlightthemeingeneralinVSCodeusersettings【发布时间】:2020-10-1307:11:04【问题描述】:我想为深色或浅色主题变体自定义VSCode颜色设置一般,例如:"w... 查看详情

在 Doc Root 中为 Wordpress 创建自定义 PHP 页面 [重复]

...tml中创建一个可以与Wordpress一起使用的页面,它是当前的主题。例如,website.com/text 查看详情

是否可以在 jquery 函数中为 JQuery UI 工具提示设置不同的 UI 主题

】是否可以在jquery函数中为JQueryUI工具提示设置不同的UI主题【英文标题】:IsitpossibletosetdifferentUIthemeforJQueryUItooltipinsidejqueryfunction【发布时间】:2015-04-1908:34:00【问题描述】:是否可以在jquery函数中为JQueryUI工具提示设置不同的... 查看详情

如何在颤动中为整个应用程序设置文本颜色主题

】如何在颤动中为整个应用程序设置文本颜色主题【英文标题】:Howtosettextcolorthemeforentireappinflutter【发布时间】:2020-10-0623:25:42【问题描述】:我使用ThemeData()的方式如下:import\'package:flutter/cupertino.dart\';import\'package:flutter/materia... 查看详情

如何在 Flutter 中为禁用的文本表单字段标签的颜色设置主题?

】如何在Flutter中为禁用的文本表单字段标签的颜色设置主题?【英文标题】:HowcanIthemethecolorthedisabledtextformfield\'slabelinFlutter?【发布时间】:2019-11-2321:05:37【问题描述】:我想在我的Flutter应用中在禁用文本字段的标签上应用一... 查看详情

如何在spring boot中为每个主题动态创建单独的Kafka监听器?

】如何在springboot中为每个主题动态创建单独的Kafka监听器?【英文标题】:HowtocreateseparateKafkalistenerforeachtopicdynamicallyinspringboot?【发布时间】:2017-05-2220:25:02【问题描述】:我是Spring和Kafka的新手。我正在研究一个用例[使用SpringB... 查看详情

如何使用 CodeSandbox 在 LESS 中为 Ant Design (React) 创建自定义主题?

】如何使用CodeSandbox在LESS中为AntDesign(React)创建自定义主题?【英文标题】:HowtocreateacustomthemeforAntDesign(React)inLESSusingCodeSandbox?【发布时间】:2020-05-2114:40:15【问题描述】:环境设置为了方便使用,我已经完成了以下步骤:Here\'sal... 查看详情

我正在尝试在颤振中为一台设备订阅多个主题,但它不起作用

】我正在尝试在颤振中为一台设备订阅多个主题,但它不起作用【英文标题】:i\'mtryingtosubscribeonedevicetomultipletopicsinflutterbutitisnotworking【发布时间】:2021-12-1216:26:27【问题描述】:我试图在包含字符串列表的listOfStringAnswers上循... 查看详情

wordpress中为theme添加自定义选项

在安装新Theme主题之后,通过控制面板的customize功能,可以进入自定义界面,这时候可以看到很多选项,如何增加这类选项呢?首先,在主题的inc/customizer.php中找到customize_register对应的函数,增加如下内容:  $wp_customize-&g... 查看详情

在 PHP 中将 JSON 转换为 XML,但在 XML 中为 JSON 数组创建一个容器元素

...述】:在开始之前,我在这里/互联网上阅读了很多帖子/主题,但据我了解,我认为我看到的所有解决方案都无法处理这个JSON我有一个JSON文件,我希望将其转换为XM 查看详情

如何在跳转开始列表和任务栏中为不同的主题显示不同的应用程序图标?

】如何在跳转开始列表和任务栏中为不同的主题显示不同的应用程序图标?【英文标题】:Howtoshowdifferentappiconinjumpstartlist&taskbarfordifferentthemes?【发布时间】:2021-04-2300:39:03【问题描述】:我正在开发一个UWP应用。当我从2004版... 查看详情

如何在 appengine 中为追随者流建模?

...试设计表格来建立追随者关系。假设我有一个包含用户、主题标签和其他文本的140char记录流。用户关注其他用户,也可以关注主题标签。我在下面概述了我的设计方式,但我的设计有两个限制。我想知道其他人是否有更聪明的... 查看详情

在 wamp 中为 php 启用 opcache

】在wamp中为php启用opcache【英文标题】:Enableopcacheforphpinwamp【发布时间】:2015-12-1807:04:25【问题描述】:我尝试在wamp上启用opcache,但它不起作用。我改变了这样的设置:[opcache]zend_extension=C:/wamp/bin/php/php5.5.12/ext/php_opcache.dllopcache... 查看详情

PHP:在 IF 语句中为变量赋值

】PHP:在IF语句中为变量赋值【英文标题】:PHP:AssigningvaluestoavariableinsideIFstatement【发布时间】:2011-02-1516:23:52【问题描述】:我想知道是否可以在IF语句中为变量赋值。我的代码如下:<?phpif((count($newArray)=array("hello","world"))==0)/... 查看详情

在 Windows 中为 php 配置 curl 扩展

】在Windows中为php配置curl扩展【英文标题】:configuringcurlextensionforphpinwindows【发布时间】:2011-08-1616:12:48【问题描述】:我正在使用带有php5的Xampp服务器。我一直在尝试让curl扩展工作。但是,做不到。我取消注释php.ini中的php_curl... 查看详情

php在php中为cli(控制台,终端)添加颜色(代码片段)

查看详情

如何在 PHP 中为 PDF 文件添加覆盖/图章?

】如何在PHP中为PDF文件添加覆盖/图章?【英文标题】:Howtoaddanoverlay/stamptoaPDFfileinPHP?【发布时间】:2012-03-1415:35:32【问题描述】:有谁知道如何在PHP中以编程方式向PDF文件添加叠加层或图章?到目前为止,我想出的最好的方法... 查看详情