This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* | |
* You can find the complete tutorial for this here: | |
* https://pluginrepublic.com/woocommerce-custom-fields | |
* | |
* Alternatively, check out the plugin | |
* https://pluginrepublic.com/wordpress-plugins/woocommerce-product-add-ons-ultimate/ | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: Pharmacy | |
* Plugin URI: http://domain.com | |
* Description: Add extra info for pharmacy products | |
* Author: Your name | |
* Author URI: http:// domain.com | |
* Version: 1.0 | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Company\Module\Block\Product\ProductList; | |
class Toolbar extends \Magento\Catalog\Block\Product\ProductList\Toolbar | |
{ | |
public function setCollection($collection) { | |
$this->_collection = $collection; | |
$this->_collection->setCurPage($this->getCurrentPage()); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Add "Sort by discount" to sorting options. Defaults to biggest to smallest discount. | |
*/ | |
add_filter( 'woocommerce_get_catalog_ordering_args', 'mycode_woocommerce_add_salediscount_to_catalog_ordering_args' ); | |
function mycode_woocommerce_add_salediscount_to_catalog_ordering_args( $args ) { | |
$orderby_value = isset( $_GET['orderby'] ) ? woocommerce_clean( $_GET['orderby'] ) : apply_filters( 'woocommerce_default_catalog_orderby', get_option( 'woocommerce_default_catalog_orderby' ) ); | |
if ( 'discount' == $orderby_value ) { | |
$args['orderby'] = 'meta_value_num'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
define('MAGENTO', realpath(dirname(__FILE__))); | |
require_once MAGENTO . '/app/Mage.php'; | |
Mage::app(); | |
$category = Mage::getModel('catalog/category'); | |
$tree = $category->getTreeModel(); | |
$tree->load(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
define('MAGENTO', realpath(dirname(__FILE__))); | |
require_once MAGENTO . '/app/Mage.php'; | |
Mage::app(); | |
$category = Mage::getModel ('catalog/category'); | |
$tree = $category->getTreeModel(); | |
$tree->load(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
##Device = Desktops | |
##Screen = 1281px to higher resolution desktops | |
*/ | |
@media (min-width: 1281px) { | |
//CSS | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function() { | |
if (window.JpegCamera) { | |
var camera; // placeholder | |
// Add the photo taken to the current Rekognition collection for later comparison | |
var add_to_collection = function() { | |
var photo_id = $("#photo_id").val(); | |
if (!photo_id.length) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Rename these to the form input names you are going to use. | |
* When you create a new attribute in Properties->Settings->Developer | |
* the form input name will appear greyed out under the attribute name | |
*/ | |
define('SPRP_SEARCH_FROM_KEY', 'price_from_per_month'); | |
define('SPRP_SEARCH_TO_KEY', 'price_to_per_month'); | |
function parse_search(){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* If you are using BP 2.1+, this will insert a Country selectbox. | |
* Add the function to bp-custom.php and then visit .../wp-admin/users.php?page=bp-profile-setup | |
*/ | |
function bp_add_custom_country_list() { | |
if ( !xprofile_get_field_id_from_name('Country') && 'bp-profile-setup' == $_GET['page'] ) { | |
NewerOlder