New answers tagged woocommerce
0
First I'll answer your question the way you were going about it and then I'm going to answer it the way I think it should be done.
CSS
You can do this with CSS in a couple different minor ways:
1) You can target any product page:
.single-product .amount:after{
content: "/m2";
text-size: 13px;
}
2) You can target any specific product with it's ...
0
Actually, with a little digging this is quite easy to do. WooCommerce has already set up a filter so all you have to do it add a small snippet in your functions.php file.
// Modify the default WooCommerce orderby dropdown
//
// Options: menu_order, popularity, rating, date, price, price-desc
function my_woocommerce_catalog_orderby( $orderby ) {
...
2
You can do the sharing of users fairly easily.
Basically, both sites would use the same database (set up in wp-config.php), but each would get it's own, unique $table_prefix.
From there, you can specify custom user and user meta tables that are the same for each site.
<?php
// site 1 wp-config.php
$table_prefix = 'site1_';
define('CUSTOM_USER_TABLE', ...
0
I would start by looking into the set_user_role action hook. You would be passed 3 arguments to your callback function - the User ID, the new user role, and an array of the old user roles(that seems strange to me, that you can't pass an array of roles, but oh well).
So here's an example code - I'm not certain for how you would get the sites that the user ...
0
I didn't entirely resolved my problem. My client changed his mind and didn't want the sorting anymore.
But concerning the paging, I managed to have it working by adding a new arg in my query, here is the code that made it worked for me :
<?php
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$args = array(
'post_type' ...
0
You can use a filter to change the text or the min price, this will affect all variable products.
add_filter('woocommerce_variable_price_html', 'custom_price_text', 10, 2);
function custom_price_text( $price, $product ) {
$price = '';
$price .= '<span class="from">' . _x('A4 Sample', 'min_price', 'woocommerce') . ' </span>'; ...
0
This should remove the WooCommerce title from it's hook, however judging from the "Additional Information" also displaying twice, I'd say you have something else going on:
function wpa_82632(){
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_title', 5 );
}
add_action( 'woocommerce_single_product_summary', 'wpa_82632', 99 ...
0
The slider is not a part of WooCommerce, right? I would add the pictures of the product to the slider, not the "product" itself. If your slider lets you add links to the images, you could make each picture link to the product's page.
Hope that helps!
0
you can use get_currentuserinfo to echo current user lastname
function echo_save() {
global $woocommerce;
global $current_user;
get_currentuserinfo();
echo 'User last name: ' . $current_user->user_lastname,
}
0
It seems that you want to create menu link to archive of each product category
do this
Goto WorPress dashboard>Products>Categories
Mouse over on any category and click on view, you goto link like http://example.com/product-category/tshirts/ in browser address bar copy it.
create a custom menu item with that link and put it in your menu.
or
create custom ...
0
use woocommerce_single_product_summary action hook with priority 15
//test
add_action('woocommerce_single_product_summary','ravs_credits',15);
function ravs_credits(){
echo'testing';
}
above code print testing below price on product page.
Important Link:
woocommerce_single_product_summary hook
WordPress hooks introduction
Updated:
I am assuming ...
0
try it like this:
/**
* This code should be added to functions.php of your theme
**/
add_filter('woocommerce_variable_price_html', 'custom_variation_price', 10, 2);
function custom_variation_price( $price, $product ) {
$price = '';
if ( !$product->min_variation_price || $product->min_variation_price !== $product->max_variation_price ) $price .= ...
1
Short answer, use:
$args = array('show_in_menu' => 'woocommerce');
register_post_type('my_posttype', $args);
But this won't give you the custom post type submenus.
You can also use add_submenu_page, the code below is just an example:
function register_my_custom_submenu_page() {
add_submenu_page( 'woocommerce', 'My Custom Submenu Page', 'My Custom ...
0
This question may be better served on Serverfault, look into setting up a domain alias or 302 'masked' redirect. However the point of an SSL is to verify a domain or a business entity so this might be moot. I would pop over to namecheap or cheapSSL and buy a cheap SSL cert.
1
example woocommerce structure:
shop
|
|-category1
| |
| |-product1
| |-product2
|
|-category2
|
|-subcategory2.1
| |
| |-product3
| |-product4
|
|-subcategory2.2
|
|-product5
|-product6
each (sub)category has it's own archive page. instead of showing the main shop page in your menu, just put those pages ...
0
code
function wc_origin_trail_ancestor( $link = false, $trail = false ) {
if (is_product_category()) {
global $wp_query;
$q_obj = $wp_query->get_queried_object();
$cat_id = $q_obj->term_id;
$descendant = get_term_by("id", $cat_id, "product_cat");
$descendant_id = $descendant->term_id;
...
0
Wherever the actual file is, you should be able to FTP to it and simply replace it with a file with the exact same name. Unless Woocommerce keeps some kind of filesize account of what is there, it shouldn't know the difference as to whether it is delivering the old file or the new file.
0
Normally themes output only excerpt (or preview as you call it) in the blog feed. If you want to output the whole content, it is possible by changing either the template that is used as the looping template or by changing the output function from excerpt to content.
Basically you just need to find the template that outputs the excerpt (preview) and change ...
0
Try something like this:
by ID
function woocommerce_subcats_from_parentcat_by_ID($parent_cat_ID) {
$args = array(
'hierarchical' => 1,
'show_option_none' => '',
'hide_empty' => 0,
'parent' => $parent_cat_ID,
'taxonomy' => 'product_cat'
);
$subcats = get_categories($args);
echo '<ul ...
0
I believe what you are looking for is the downloadable line items where you can also grant access to new downloads.
that screenshot it taken from
http://docs.woothemes.com/document/digitaldownloadable-product-handling/
0
Do you absolutely have to use qTranslate to do it?
If not, read the official documentation for recommended method of translation:
http://docs.woothemes.com/document/woocommerce-localization/
Also try any plugin that is made to integrate with WooCommerce such as WPML.
Fixing compatibility between two plugins that is not integrated is not really worth the ...
0
thanks but i get my answer any other source.
and my answer is
$args = array(
//'number'=> $number,
//'orderby'=> $orderby,
//'order'=> $order,
'hide_empty'=> false,
//'include'=> $ids
);
$product_categories = get_terms( 'product_cat', $args );
foreach($product_categories as $catval)
{$catval->name;
$link = esc_url( ...
0
are we talking about the single product view or the product archive pages (shop,categories)?
because the text beside the checkbox/option states, roughly translated:
»activate ajax-checkout-button on product archive pages«
and on all the installations i did so for, that is the way its working - ajax checkout on the archives, but not on the single view.
...
0
if i'm not totally mistaken you can configure woocommerce that way
-shop
--category1
---product1.1
---product1.2
--category2
---product2.1
---product2.2
without any coding and very easy from your wordpress backend, take a look at:
"woocommerce>settings>catalog"
1
This is what I do to rename menu items: in the action hook admin_menu, use a recursive array search to pinpoint the key position of the desired menu and then modify the global $menu array.
add_action( 'admin_menu', 'rename_woocoomerce_wpse_100758', 999 );
function rename_woocoomerce_wpse_100758()
{
global $menu;
// Pinpoint menu item
$woo = ...
0
as suggested by kaiser, my last working edit as solution:
ok, inspired by @s_ha_dum answer i manged to get a solution:
//this 1. part is out of the woocommerce-template.php and part of the woocommerce_product_subcategories()
$product_cat = get_term_by( 'slug', $product_cat_slug, 'product_cat' );
$product_category_parent = $product_cat->term_id;
...
1
It's common to find theme that you can't simply override certain file by mirroring the file structure in your child theme.
In this case the cart.min.js is most likely included via wp_queue_script so you gotta find the handle of the script by looking at the source code of WooCommerce (just search by wp_enqueue_script). Then you can run wp_dequeue_script on ...
0
As it often goes, I figured it out just after asking for help and taking a second look, and it was a lot simpler than I thought.
Apparently it's as easy as adding has_term('the-category-slug','product_cat') to my conditional statements.
That returns true if a single product is in the specified category, since WooCommerce is using taxonomies for product ...
1
I hate to offer an answer that isn't too much more than a link, but well the question itself is very weak and most importantly there's little incentive to build this yourself when it already exists as a plugin:
http://www.woothemes.com/products/woocommerce-subscriptions/
You could either create different products for each of the subscription plans, or now ...
0
Goto your wordpress phpmyadmin open database
1.All Woocommerce orders save in table-prefix_posts table
2.and Woocommerce order's meta info like :billing-addres,customer-name store in table-prefix_postmeta table
run SQL command in phpmyadmin
SELECT *
FROM `table-prefix_postmeta`
WHERE `post_id` = any order-id
LIMIT 0 , 30
you get list of product ...
Top 50 recent answers are included


