categories

Magento 1.7 Add attribute to category

↘锁芯ラ 提交于 2019-12-11 05:37:28
问题 I'm trying to add to the field list of the categories a new text field called "website_url". I found many tutorials but none works on magento 1.7. I created a new module as following : -code\local\SaponeWebConcept\CategoriesAttributes\sql\categoriesattributes_setup\mysql4-install-0.1.0.php : <?php $installer = $this; $installer->startSetup(); $installer->addAttribute('catalog_category', 'website_url', array( 'type' => 'text', 'backend' => '', 'frontend' => '', 'label' => 'Lien du site',

Woocommerce: Customizing the availability of a category

血红的双手。 提交于 2019-12-11 05:20:55
问题 I have many products nested within parent categories in WooCommerce. I want to be able to apply a custom field where I can specify a time availability for categories as a admin feature only in Back end. Theory: Back end - On each parent category I will have this custom field where I can type or choose a time frame : for example 11:00-17:00 . Front end: During this time frame , users will be able to browse all the products within that category. Outside of this time frame all the products

Wikipedia API - is there a general 'music' category?

怎甘沉沦 提交于 2019-12-11 03:35:32
问题 I have a problem with Wikipedia API. I am using openSearch to get results with links to wikipedia pages. However open search doesn't seem to support +incategory. What is more, I would like to search for music artist (bands, solo singer and all other type of musicians). However I can't find any category named 'music'. The categories are too specific (i.e. 1980s music groups, solo singers etc.). However when you look at disambiguation page of wikipedia for example for offspring you can see this

What's the need of Informal Protocols?

China☆狼群 提交于 2019-12-11 02:38:38
问题 I've read the online docs about formal and informal protocols on Apple's documentation site, but I missed the point about informal protocols. I mean, a class cannot conform to an informal protocol, it conforms to it by default since informal protocols are almost always categories of the NSObject class. If you want to implement an informal protocol, you must redeclare the methods you want to implement in your interface file. Another class cannot check if you conform to the informal protocol

Magento - Assign attributes to categories in layered navigation

非 Y 不嫁゛ 提交于 2019-12-11 02:29:06
问题 I've been working with Magento for a few months now. I have a Products category with 7 sub-categories. These categories are various brands with sub-categories of types of products. I'm looking to add certain attributes to each of these brand's products individually. For example, in 'Brand 1' there is 'Types of Drawers' attribute of: 2 Drawer, 4 Drawer. There are others I need to sort by according to what category it is in. The problem is that Magento doesn't seem to do this natively. That

Checking that one of multiple mandatory products categories are in cart

回眸只為那壹抹淺笑 提交于 2019-12-11 01:27:33
问题 I have to check if one of my two mandatory products categories is in cart. I have customized the code from this answer: Allow checkout only when a product of a mandatory category is in cart But with my custom code, it always checks for only one of them and I get some errors. My code is not working. How can I make it work for 2 product categories instead of one? Here is the code: // Function that define the mandatory product category function your_mandatory_category_slug(){ // DEFINE HERE the

Facebook Graph Api filter feed by category

余生颓废 提交于 2019-12-11 01:14:31
问题 Does anyone know how to filter a users feed by category using the graph api? For instance.... I would like to pull the users news feed that relates to only Music like http://graph.facebook.com/me/home?from_category=Music Any help would be much appreciated.... Thanks! 回答1: as much I know, there is no direct way to query graph api for getting filtered feed though if you know the filter_key for a particular filter type of a user stream,then you can query the graph api with identifier filter. so

wordpress functions.php - use different page template for each post category

Deadly 提交于 2019-12-11 00:15:31
问题 I want to hook into the save_post function, find out what category the post is in, and then assign a different page template for posts in each category. I've tried about 30 different versions of this with no luck. Will someone please help point me in the right direction? add_action( 'save_post', 'assign_custom_template' ); function assign_custom_template($post_id) { $category = get_the_category($post_id); $cat_id = $category->cat_ID; if( $cat_id == 1 ) { update_post_meta($post_id, "_wp_page

Wordpress Category Link get_category_link(id)

放肆的年华 提交于 2019-12-10 21:50:17
问题 I need to link to a category in my wordpress site. The following code works, somewhat: <?php // Get the ID of a given category $category_id = get_cat_ID( 'People' ); // Get the URL of this category $category_link = get_category_link( $category_id ); ?> My problem is that it includes /category/ in the url, which isn't how my permalink structure is designed. Does anyone know a way around including /category/ in the url it outputs? 回答1: I don't understand what you want to do. Look here Template

Max item quantity added to cart based on product category in Woocommerce

久未见 提交于 2019-12-10 18:25:46
问题 I am trying to customize the shop such that Category named Quantity4 allows only 4 items to be added in the cart and category named Quantity6 allows only items to be added in the cart. As far as I can get, this can be achieved using nested if statements, but somehow this doesn't work. add_filter( 'woocommerce_add_to_cart_validation', 'only_four_items_allowed_add_to_cart', 10, 3 ); function only_four_items_allowed_add_to_cart( $passed, $product_id, $quantity ) { $cart_items_count = WC()->cart-