I need to delete the space after product description in woo commerce product page
By : user1701920
Date : March 29 2020, 07:55 AM
this one helps. I guess you wanted to hide that "related products" section below the product description. You should add some CSS code :
section.related.products {
display: none;
}

Python Combinations and product
By : Kevin Mulhern
Date : March 29 2020, 07:55 AM
it should still fix some issue Here is a more robust/general way of doing the sort of thing you want. I start by defining a helper function: code :
from itertools import combinations, chain, product
def subsets_of_length(s, lengths):
return chain.from_iterable(combinations(s,l) for l in lengths)
>>>> list(subsets_of_length(['a','b','c'], range(2,4)))
[('a', 'b'), ('a', 'c'), ('b', 'c'), ('a', 'b', 'c')]
>>>> list(subsets_of_length(['d','e'], range(0,2)))
[(), ('d',), ('e',)]
>>>> for choices in product(
subsets_of_length(['a','b','c'], range(2,4)),
subsets_of_length(['d','e'], range(0,2)),
):
print(' '.join(str(subset) for subset in choices))
('a', 'b') ()
('a', 'b') ('d',)
('a', 'b') ('e',)
('a', 'c') ()
('a', 'c') ('d',)
('a', 'c') ('e',)
('b', 'c') ()
('b', 'c') ('d',)
('b', 'c') ('e',)
('a', 'b', 'c') ()
('a', 'b', 'c') ('d',)
('a', 'b', 'c') ('e',)
>>>> for choices in map(chain.from_iterable,product(
subsets_of_length(['a','b','c'], range(2,4)),
subsets_of_length(['d','e'], range(0,2)),
)):
print(' '.join(column for column in choices if column))
a b
a b d
a b e
a c
a c d
a c e
b c
b c d
b c e
a b c
a b c d
a b c e
for choices in map(chain.from_iterable,product(
subsets_of_length(['AA','AS','AD'], [1]), #only one of these
subsets_of_length(['BB','BC'], [1,2]), #at least one of these
subsets_of_length(['CD','CF','CG'], [0,1,2,3]), #All, 1, 2 or none of these
)):
print(' '.join(column for column in choices if column))

How can i find unique combinations of 2 columns, delete not unique combinations, keeping only first rows in pandas
By : cha
Date : March 29 2020, 07:55 AM
Does that help I have a dataset that contains 2 columns. And there are data combinations. I want to find if there are not unique combinations and delete them keeping only the first row. , I believe you need sorting each row and remove duplicates: code :
df = (pd.DataFrame(np.sort(df[['dim', 'linked_dim']], axis=1),
columns=['dim', 'linked_dim'])
.drop_duplicates())
print (df)
dim linked_dim
0 Customer group$Large DEPARTMENT$Sales
1 Customer group$Medium DEPARTMENT$Sales
2 Customer group$Small DEPARTMENT$Sales

Can Cartesian product of two lists return all the combinations except the combinations involving two same elements?
By : user3018564
Date : March 29 2020, 07:55 AM
it fixes the issue For Example , Try it with itertools permutations code :
import itertools
list(itertools.permutations(['a','b','c'], r=2))
[('a', 'b'), ('a', 'c'), ('b', 'a'), ('b', 'c'), ('c', 'a'), ('c', 'b')]
list(itertools.permutations([[1,2],[2,3],[1,2]], 2))
[([1, 2], [2, 3]), ([1, 2], [1, 2]), ([2, 3], [1, 2]), ([2, 3], [1, 2]), ([1, 2], [1, 2]), ([1, 2], [2, 3])]

Woocommerce when deleting a product, automatically also delete the product gallery and product image
By : stella droid
Date : March 29 2020, 07:55 AM
seems to work fine Although this is an old question, I will leave it here in case someone will be looking for it in the future. Since you want to delete product images, you may try these neat and handy woocommerce functions to get attachments ids.

