如何让仅注册用户看到woocommerce 用户注册产品价格

WooCommerce的Shop页面虽然有固定格式,依然可以在编辑器中输入内容,输入shortcode时会强制执行wpautop,导致shortcode输出带上很多p和br标签,其自带shortcode亦无法幸免,使用WC&2.2.4时发现了这个问题。问题描述例如在商店页面使用featured_products shortcode,产生的结果如下图所示,箭头所指的位置是强制将换行符转换成p导致的副作用,空的a标签。
尽管这不会百分之百导致样式问题,但能避免还是避免之。原因woocommerce的店铺页面最开始会输出一段描述性文字,相当于文章的内容。一般输出内容使用the_content()函数,而woocommerce却直接硬编码了wpautop,于是shortcode里只要有换行就会被影响,一般的remove_filter方法无法解决。
解决既然wpautop无法跳过,那只能把shortcode中会让wpautop起作用的因素去掉,即删除换行符。通常shortcode结尾会返回一段字符串...return $在返回前先删除换行符和多余空格,就能避免这个问题...return str_replace(array(&/r/n&, &/r&, &/n&, &/t&, '', '', ''), '', $output);Password protect woocommerce shop page [密码保护页面WooCommerce店] - 问题-字节技术
Password protect woocommerce shop page
密码保护页面WooCommerce店
问题 (Question)
I have a woocommerce default shop page and I would like only for customers with a password (no username) to be able to access it. I am not worried about protecting the contents of the store, but I would like a simple login for users to enter the shop page.
I usually use wordpress' password protection feature for this, however, it does not appear to work with woocommerce. Has anyone successfully password protected a woocommerce shop page?
我有一个默认的页面和商店WooCommerce我想只有用密码客户(没有用户名)能够访问它。我不担心保护存储的内容,但我想为用户进店的一个简单的登陆页面。我通常使用此,WordPress的密码保护功能,但是,它不会出现与WooCommerce。有人成功密码保护页面WooCommerce店?谢谢!
最佳答案 (Best Answer)
I'm not 100% sure if it will work but Wordpress 3.8 (or woocommerce adds the feature)has built in password protect.
If you go into pages > shop > edit visibility (same box as update / publish button) you should have the option to password protect the page.
Hope this helps
我不是100%肯定,如果它会工作但是WordPress 3.8(或WooCommerce加特征)具有内置的密码保护。 shop& edit visibility (same box as update / publish button) you should have the option to password protect the page."&如果你走进商店&编辑页&能见度(更新/发布按钮盒)你应该选择密码保护页面。希望这会有所帮助
答案 (Answer) 2
I didn't protect the main SHOP page, but I have a Wholesale page that I protected.
I was using the Neighbourhood theme which has Swift Page Builder. I created a category in Woo that was called 'wholesale'. In the Wholesale page, I inserted the Products widget using Swift Page Builder. In the Product widget, I told it to pull the category "wholesale".
I then used WordPress' built in password on the Wholesale page and added it to the main nav.
Hope that helps a little.
Good luck!
我没有保护的主要商店的网页,但我有一个批发页面,我保护。我用的是附近的主题,有迅速的页面生成器。我创造了在宇一类,被称为“批发”。在批发页面,我插入了产品部件使用SWIFT页面生成器。在产品的部件,我告诉它把范畴的“批发”。然后我使用WordPress的内置的密码在批发页面并把它添加到主导航。希望有点帮助。祝你好运!
本文翻译自StackoverFlow,英语好的童鞋可直接参考原文:如何改变WooCommerce的商品列表样式_百度知道Woocommerce:如何根据国家设置支付方式 – ~SolagirL~

我要回帖

更多关于 woocommerce 用户注册 的文章

 

随机推荐