texts:
I am trying to work out whether it is possible to reserve a product with the option to then either purchase or cancel at a later date.

I appreciate this goes against the idea of "selling" but i am setting up a site for selling limited edition pieces of art. Sometimes the pieces will be reserved by an agent before a sale is agreed.

Also, as most of the pieces will be paid by bank transfer, technically the piece of art is not sold until the money has been transferred and funds cleared.

Any thoughts or ideas on this would be appreciated.

Many thanks


texts: DHL - Not Able to change Ship to Specific Countries and Ship to Applicable Countries

texts:
1) I can't able to selected specific countries, if i selected all countries except INDIA half of the countries not choosing, i mean not selected.

2) If i change Ship to Applicable Countries as All allowed countries  its not changing.

Screen Shot:

Note : There is no error log.


texts: magento 2 customer groups get group_renderer in system configuration

texts:
I need to display all customer groups in dropdown in magento2 admin configuration but customer group_renderer is not working. can anyone please help me.

public function _prepareToRender()
    {
        /** @var CustomAdminConfigHelperData $helper */
        $helper = $this->helperData;

        $this->addColumn('referral_url', ['label' => __('Referral URL / Domain'),'style' => 'width:200px']);
        $this->addColumn('customer_group', ['label' => __('Customer Group'),'style' => 'width:200px','renderer' => $this->_getGroupRenderer()]);

        $this->_addAfter = false;
        $this->_addButtonLabel = __('Add');
    }
    protected function  _getGroupRenderer()
    {
        if (!$this->_itemRenderer) {
            $this->_itemRenderer = $this->viewLayoutFactory->create()->createBlock(
                'Customergroupauto/GroupConfig/Groups', '',
                ['is_render_to_js_template' => true]
            );
        }
        return $this->_itemRenderer;
    }


texts: magento 2 custom collection pager with dynamic url

texts:
I use backend option to set an url for my page, now i want to add pager to that page:

$pager = $this->getLayout()
    ->createBlock(
        'Magento\Theme\Block\Html\Pager',
        'module.custom.pager'
    )->setAvailableLimit(array(2=>2))
    ->setShowPerPage(true)
    ->setCollection(
        $this->getCustomCollection()
);
$this->setChild('pager', $pager);

this code adds pager but it shows module URL(specified in route.xml) URL if we use pager and not the specified one.

public function match(\Magento\Framework\App\RequestInterface $request)
{
    $path = trim($request->getPathInfo(), '/');
    $array = explode('/', $path);
    if(strpos($path, $this->getFrontendUrl()) !== false) {
        $request->setModuleName('modulename')
            ->setControllerName('index')
            ->setActionName('index');
        if(isset($array[1])){
            $request->setParam('param', $array[1]);
        }
   } else {
       return false;
   }
   return $this->actionFactory->create(
       'Magento\Framework\App\Action\Forward',
       ['request' => $request]
   );
}
/**
 * @return string
 */
public function getFrontendUrl(){
    return $this->_scopeConfig->getValue('section/group/customurl', \Magento\Store\Model\ScopeInterface::SCOPE_STORE);
}

one option which I'm aware of is to use URL rewrites, is there any other way?


texts: Magento NGINX allow IP/deny all for downloader folder

texts:
I'm having a problem allowing my IP address access to the downloader folder when using nginx to deny all other IP's. Any ideas where I'm going wrong with the below? I've tried with my IPv4 and IPv6 address, neither works and results in a 403 forbidden.
(Domain and IP I've replaced for security)

   server {
    listen   80 default;

    root /var/www/mywebsiteaddress.co.uk/httpdocs;
    server_name mywebsiteaddress.co.uk;

    location / {
        index index.html index.php;
        # First attempt to serve request as file, then
        # as directory, then fall back to displaying a 404.
        try_files $uri $uri/ @handler;
    }

    ## These locations would be hidden by .htaccess normally
    location ^~ /app/                { deny all; }
    location ^~ /includes/           { deny all; }
    location ^~ /lib/                { deny all; }
    location ^~ /media/downloadable/ { deny all; }
    location ^~ /pkginfo/            { deny all; }
    location ^~ /report/config.xml   { deny all; }
    location ^~ /var/                { deny all; }
    location ^~ /downloader/     { allow 123.456.789.0; deny all; }

    location /var/export/ { ## Allow admins only to view export folder
        auth_basic           "Restricted"; ## Message shown in login window
        auth_basic_user_file htpasswd; ## See /etc/nginx/htpassword
        autoindex            on;
    }

    location  /. { ## Disable .htaccess and other hidden files
        return 404;
    }

    location @handler { ## Magento uses a common front handler
        rewrite / /index.php;
    }

    location ~ .php/ { ## Forward paths like /js/index.php/x.js to relevant handler
        rewrite ^(.*.php)/ $1 last;
    }

    location ~ \.php$ {
        if (!-e $request_filename) { rewrite / /index.php last; } ## Catch 404s that try_files miss

        expires        off; ## Do not cache dynamic content
        fastcgi_pass   unix:/var/run/php5-fpm.sock;
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        fastcgi_param  MAGE_RUN_CODE default; ## Store code is defined in administration > Configuration > Manage Stores
        fastcgi_param  MAGE_RUN_TYPE store;
        include fastcgi_params;
    }
}


texts: Magento 2 Custom Product Price Calculation and Overriding Cart Totals

texts:
Background:
I am working on a project with very custom price calculations for specific transfer products. These transfer products have tiered pricing applied to them, however, the first product purchased is always charged at £13.17, subsequent products are then charged at the tiered product rate for the quantity being purchased
e.g. When a customer purchases 10 bespoke transfers 1 should be charged at £13.17 and 9 should be charged at £7.75.
I have achieved this using pricing using the checkout_cart_product_add_after and checkout_cart_update_items_after events. However, the custom price set for the products in the observer, more often than not comes to 3 or 4 decimal places. Using the example above the average price for each product is £8.2920. Magento then rounds this to the nearest 2 decimal places (£8.29) making the order total £82.90, instead of £82.92. The higher the order quantity, the further out the two figures are.
Current Approach
Created an observer for the sales_quote_address_collect_totals_after event, where I am using the setRowTotal and setBaseRowTotal functions to correct the total value for each transfer item in the cart.
The Problem
I am modifying the the $total's object within the observer which is temporarily changing the subtotal value in the summary box, however, the spinning wheel appears and reverts the subtotal value back to the original value.
Below a screenshot of the cart with a corrected $item rowTotal value but incorrect subtotal.

How do I override the cart totals without them being reverted back? I also need the tax amount and grand total to reflect the updated totals for each item in the cart.
Below is the execute function of my sales_quote_address_collect_totals_after observer
public function execute(\Magento\Framework\Event\Observer $observer)
    {

        $quote = $observer->getData('quote');
        $shippingAssignment = $observer->getData('shipping_assignment');
        $total = $observer->getData('total');

        if ($quote->hasItems()) {

            $customTotal = 0;
            foreach($quote->getItems() as $item) {
                $customTotal = $customTotal + ($item->getCustomPrice() * $item->getQty());
                // override the row totals for each product using the custom price
                $item->setRowTotal($item->getCustomPrice() * $item->getQty());
                $item->setBaseRowTotal($item->getCustomPrice() * $item->getQty());
            }

        }

        // override totals price (not sure on effect with tax)
        $total->setTotalAmount('subtotal', $customTotal);
        $total->setBaseTotalAmount('subtotal', $customTotal);
        $total->setSubtotalWithDiscount($customTotal);
        $total->setBaseSubtotalWithDiscount($customTotal);
        $total->setBaseWithDiscount($customTotal);

        return $this;
    }

Thanks in advance for any help with this issue.


texts: How to ask the customer to enter billing and shipping address while registering their account in magento 2

texts:
I wish to get the billing address and shipping address while customer registering their account in Magento 2.

I just overrode the register.phtml & copied the address fields for both shipping and billing address separately.

While viewing in shipping address it is failed to show the state select box?

If I get it separately, then how do I save it.

Please refer the attached screenshot


texts: InstallSchema not running even though module is not installed

texts:
I searched all over and don't see anyone with the same issue.

Below are steps I tried to solve this with no success

I deleted the module from setup_module table.
I don't see any errors in var/log/debug I don't see the log below, I do see the log from registration.php I put in
It works for the other plugin I have under BB/StoreSchedule/Setup

I tried running the commands below:

php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento cache:clean
I looked over my code for typos 50+ times
I did not see the log from the InstallSchema in the log file.

Please any suggestions!

I am running Magento ver. 2.3.2

I am running on a mac using https://github.com/markshust/docker-magento as my dev environment

Running in the following mode

app@c98698704947:~/html$ php bin/magento deploy:mode:show
Current application mode: default. (Note: Environment variables may override this value.)

InstallSchema.php

<?php

namespace BB\CustomerGroup\Setup;

use Magento\Framework\Setup\InstallSchemaInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\SchemaSetupInterface;

/**
 * @codeCoverageIgnore
 */
class InstallSchema implements InstallSchemaInterface
{
  /**
   * {@inheritdoc}
   * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
   */
  public function install(SchemaSetupInterface $setup, ModuleContextInterface $context)
  {
    $writer = new \Zend\Log\Writer\Stream(BP . '/var/log/debug.log');
    $logger = new \Zend\Log\Logger();
    $logger->addWriter($writer);
    $logger->info('TEST GOT HERE');

    $setup->startSetup();
    $table = $setup->getTable('customer_group');
    $setup->getConnection()->addColumn(
      $table,
      'zip_codes',
      [
        'type' => \Magento\Framework\DB\Ddl\Table::TYPE_TEXT,
        'length' => 255,
        'nullable' => true,
        'default' => '',
        'comment' => 'Zip codes covered by this customer group'
      ]
    );
    $setup->endSetup();
  }
}


texts:
I'm looking for the bulk variant of the product stock update API
/rest/default/V1/products/{productSku}/stockItems/{itemId}

Objective:
I want to update quantities of multiple products in one API call
What I've tried
I checked the Magento2 guides on bulk APIs and came across this Bulk endpoints | Magento 2 Developer Documentation and based on the info from there updated the above link to this
PUT rest/async/bulk/V1/products/byProductSku/stockItems/byItemId

and this is the body
[
    {
        "productSku": "Test-Product",
        "stockItem": {
            "itemId": 32,
            "qty": 338,
            "is_in_stock": true,
            "use_config_manage_stock": false
        }
    }
]

But this isn't working, I'm getting the error
{
    "message": "Internal Error. Details are available in Magento log file. Report ID: webapi-..."
}

My two main concerns are whether there is an API i can use that already does this, or if my approach mentioned above is possible and I need to change something to fix the issue.


texts:
URL/V1/products/?searchCriteria[filter_groups][0][filters][0][field]=name&searchCriteria[filter_groups][0][filters][0][value]=10&searchCriteria[filter_groups][0][filters][0][condition_type]=eq

URL: URL/V1/products
Params to pass:

searchCriteria[filter_groups][0][filters][0][field]=name
searchCriteria[filter_groups][0][filters][0][value]=10
searchCriteria[filter_groups][0][filters][0][condition_type]=eq

Method: GET
I am trying to pass the URL parameters not direct in the URL but using the headers.
Here my attempt, but doesn't work:
function getProducts() {

 var params = {
 searchCriteria[filter_groups][0][filters][0][field]:name,
 searchCriteria[filter_groups][0][filters][0][value]:10,
 searchCriteria[filter_groups][0][filters][0][condition_type]:eq
}

var options = {
'headers': {
'Content-Type': "application/json",
'Accept': "application/json",
'Authorization': TOKEN,
'method': "get",
'Request': params
}
};

  var url = 'URL/rest/V1/products';
  var res = UrlFetchApp.fetch(url, options);
  Logger.log(res);
}

Any help?


texts: Getting black background after adding PNG transparent image for products

texts:
Hello I am using Magento version 2.1.7. When I try to add any transparent PNG image to any product then in frontend it is displaying with black background instead of white. The image is not saving correctly in pub/media/catalog/product/cache. I have tried many solutions available but nothing is working and there are most of solution for magento 1.9 not for 2.1 . So Please help me to resolve this as I can't update my magento version.

FYI:The image uploaded:

The image in frontend:

Thank You


texts: error while adding custom option programatically on product save event in magento 2

texts:
I was trying to add the custom option programatically at the time of product save event.But when i tried it it is redirecting to a "Page not working" Page.

The code I tried on the observer is

<?php

namespace Custom\Addcustomoption\Observer\Catalog;

class ProductSaveAfter implements \Magento\Framework\Event\ObserverInterface
{

    /**
     * Execute observer
     *
     * @param \Magento\Framework\Event\Observer $observer
     * @return void
     */
     protected $ObjectManager;
     protected $product;

   public function __construct(
     \Magento\Framework\ObjectManagerInterface $ObjectManager,
     \Magento\Catalog\Model\Product $product
  ){

    $this->_objectManager = $ObjectManager;
    $this->_product = $product;

  }
    public function execute(
        \Magento\Framework\Event\Observer $observer
    ) {

        $_product = $observer->getProduct();  // you will get product object
        $productId = $_product->getId();
        $_products = $this->_objectManager->create('\Magento\Catalog\Model\Product')->load($productId);

        if(!$_products->getHasOptions()){

            try{

                $customOption = $this->_objectManager->create('Magento\Catalog\Api\Data\ProductCustomOptionInterface');

                $customOptions = array();
                $customOption->setTitle('Text')
                ->setType('area')
                ->setIsRequire(true)
                ->setSortOrder(1)
                ->setPrice(1.00)
                ->setPriceType('fixed')
                ->setProductSku($_products->getSku());
               //The code execute upto here
                $customOptions[] = $customOption;
                //problem is here
                $_products->setOptions($customOptions)->save();

            } catch (\Exception $e) {
                var_dump($e->getMessage());

            }

        }

    }
}

I tried to track it and the problem occurs at the time of setting the custom option to the product see the comment that i have placed on the code.

I didn't see any error on error log or apache log.

Can any one tell what could have possibly gone wrong?

Thanks,


texts: Bundle product dynamic pricing from options

texts:
Sorry if this question has been asked before but I cant find a solution to this problem and bundled products might not be the answer.

Imagine a scenario where you allowed the customer to buy a customizable picture frame. The first option is the size of the frame. The available options are 10x10", 12x12", 14x14", 20x20". The next option is frame style. Which are Classic, Regular, Brushed etc...  The problem is- is their a way to change the price dynamically depending on a previous option? For Example:

Option 1: 10x10" + Option 2: Brush = $100.00,
Option 1: 12x12" + Option 2:Brush = $120.00,
Option 1: 14x14" + Option 2: Brush = $140.00

... and so on.

A. Can customizing / changing the bundle products be a solution? or...

B. Do you have to tackle this issue another way with Magento?

Any links to blogs posts or pointers would be greatly appreciated. Thanks guys!


texts: How to disable product edit fields based on admin role in magento 2

texts:
I need to create one admin account for seo editer. This user only edit seo fields in Product edit form and category edit form

Default magento 2 Only disable menus, not a fields, I enabled only Product menu for this user.

Now, this user allows to edit, add, and delete the product and category. I need to restrict only enable seo fields in Product edit form and category edit form

reference:

Product Edit Form:

Category Edit Form:

What i did:

di.xml in below path app/code/Vendor/Module/etc/di.xml

    <?xml version="1.0"?>
    <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
        <preference for="Magento\Catalog\Controller\Adminhtml\Product\Edit" type="Vendor\Module\Controller\Adminhtml\Product\Edit" />
    </config>

Then Override the Product Edit Controller.

Vendor\Module\Controller\Adminhtml\Product\Edit.php:

    <?php
    /**
     *
     * Copyright © 2013-2017 Magento, Inc. All rights reserved.
     * See COPYING.txt for license details.
     */
    namespace Vendor\Module\Controller\Adminhtml\Product;

    class Edit extends \Magento\Catalog\Controller\Adminhtml\Product\Edit
    {

        protected $_publicActions = ['edit'];
        protected $resultPageFactory;
        protected $logger;
        protected $authSession;
        public function __construct(
            \Magento\Backend\App\Action\Context $context,
            \Magento\Catalog\Controller\Adminhtml\Product\Builder $productBuilder,
            \Magento\Framework\View\Result\PageFactory $resultPageFactory,
            \Psr\Log\LoggerInterface $logger,
            \Magento\Backend\Model\Auth\Session $authSession
        ) {
            parent::__construct($context, $productBuilder,$resultPageFactory );
            $this->resultPageFactory = $resultPageFactory;
            $this->logger =$logger;
            $this->authSession = $authSession;
        }

        public function execute()
        {
            $this->logger->addDebug("product Edit Controller");

            if ($this->authSession->getUser()->getAclRole() == 4) {
                ?>

                <script type="text/x-magento-init">
                    {
                        "*": {
                            "Vendor_Module/js/seo_field":{}
                        }
                    }
                </script>

                <?php
            }
            return parent::execute();
        }
    }

This is My Script:

seo_field.js  create following app/code/Vendor/Module/view/adminhtml/web/js/seo_field.js

 define([
        'jquery'
    ], function ($) {
        'use strict';

        console.log("testing");

        $('input[name="product[attribute_set_id]"]').prop('disabled', true);
        $('input[name="product[name]"]').prop('disabled', true);
        $('input[name="product[sku]"]').prop('disabled', true);
    });

Then, Disable the product edit fields based on name, But Not worked for  me,  script is being called fine,

Suggest me, why these fields are not disabled and how to fix this.


texts: Is there any event for Customer Login Failed in magento 2?

texts: I am creating a new extesnion in Magento 2. I need to send email regarding customer login failed to admin. Is there any event for customer login failed?


texts: I want to refresh the page automatically if users clicks on CHECK button

texts:
I want to refresh the product page automatically if the user clicks on "CHECK" button of zipcode field. I want to refresh the page automatically every time user click on CHECK button of zipcode or want to refresh the add to cart button & zipcode section as i marked in attached screenshot. I am providing you the cod.phtml

cod.phtml

<?php
/***************************************
 *** Cash On Delivery ***
 **************************************
 */

$msgData = Mage::helper('netgo_cod')->getConfigData();
if($msgData['zip_status'] == 1){
?>

        Zip Code : <input type="text" placeholder="Enter your pincode" value="" name="cod" class="product-custom-option required-entry" id="cod" size="29" style='color:black; font-size:12px'>
        <button type="button" onclick="checkCOD();" name="zip-check" title="Check" class="button" id="zip-check">Check</button>

<?php } ?>

Screenshot:


texts: Unable to process binding click: function()

texts:
I'm trying to implement a click event in one of the button I added under the Magento_Checkout module specifically under payment.html view. Now I added the below code

  File location: app/design/frontend/Vendor/Module/Magento_Checkout/web/template/payment.html

<form id="co-payment-form" class="form payments" novalidate="novalidate">
    <fieldset class="fieldset">
        <button type="button" data-bind="click: goBackShipping">Back from template</button>
    </fieldset>
</form>

Now what I want is that the goBackShipping will be triggered using KnockoutJS functionality. But I'm getting this error

  knockout.js:3391 Uncaught ReferenceError: Unable to process binding "click: function(){return goBackShipping }"

This goBackShipping function is added in the checkout-data.js under the folder

  app/design/frontend/Vendor/Module/Magento_Checkout/web/js/checkout-data.js

and here is the code I added

/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

 /**
  * Checkout adapter for customer data storage
  *
  * @api
  */
 define([
     'jquery',
     'Magento_Customer/js/customer-data',
     'jquery/jquery-storageapi'
 ], function ($, storage) {
     'use strict';

    var cacheKey = 'checkout-data',

    /**
     * @param {Object} data
     */
    saveData = function (data) {
        storage.set(cacheKey, data);
    },

   // This is the newly added function
    goBackShipping = function () {
        alert("Preparing to go back");
        window.history.back();
    },

    /**
     * @return {*}
     */
    initData = function () {

        return { ... };
    },
  };
});

Honestly I have no idea why it's giving an error like that. Am I doing something wrong? (obviously yes because it's giving an error).

I would only like to implement a button click action using knockoutjs and simple javascript alert. But I can't get pass this error.


texts:
I have localized and translated my Magento 1.7 installation almost 100% with csv translations, and some inline translations, however in my PDF invoices translations are not taking effect.

Some parts like "Ship to", "Sold to", and then "Shipping&Handling" are not translated. Also my tax is displayed like 25.000% (should be only 25%).

Anyone have idea where can I edit this? Is there any other place besides abstract and invoice.php where I can change this?


texts: How to get collection from database in phtml not from cache when full cache enabled

texts:
I have created an extension which I have uploaded in the marketplace but marketplace rejected due to cacheable="false".

<block class="Company\Module\Block\Hello" name="information" template="Company_Module::details.phtml" cacheable="false"/>

I have removed this cacheable attribute from xml then my extension not working properly.

Now if I make some process in product page or category page in my extension then data is stored properly in the database. But if when I refresh the page then it will display old data directly from cache.

If I manually apply cache clean command then refresh the page then it displays data correctly the first time.
I am getting this issue in the custom page as well as in product page and category page.

  $this->customFactory->create()->getCollection();

I have written this code in a block and used this block function in phtml.

Anyone knows how can we get collection directly from the database and not from the cache when the cache is enabled in Magento 2.


texts: Internal messaging system for logged in Admin users?

texts:
I have been searching for a solution for extending default Magento email functionality in order to send internal messages from Admin user to Admin user.

I haven't found any good resources on how to achieve this or what "events" I could hook into or Observe in order to set this up.

Would anyone happen to know what steps I could take to begin developing a module for sending internal messages between Admins?

I would be grateful even the smallest of guidance.


texts: Add product to cart with different price using observer

texts:
I currently have an observer which watches for when a product is added to the shopping cart (checkout_cart_product_add_after) and applies a custom price from the product view page. This works fine but I need for it to add a separate version of the same product to the cart if the price is different from any of the current ones. E.g. so the user can buy 1x $400 item, 2x $300 item.

Can this be done ? Currently using a simple product as nothing varies other than the price.

Here is my observer function

public function applyCustomPrice($observer)
{

    $item = $observer->getQuoteItem();

    if ($item->getParentItem()) {
        $item = $item->getParentItem();
    }

    $product = $observer->getProduct();
    $max = $product->getMaxprice();
    if($max) {
        $max = $max * 1;
    } else {
        $max = 500;
    }

    $new_price = Mage::app()->getRequest()->getPost('priceInput');

    if($new_price > $max) {
        $item->getQuote()->removeItem($item->getId());
        $message = 'You must enter a value lower than $'.$max;

        //todo: could try _dataSaveAllowed

        Mage::throwException($message);
        return;
    }

    if(!is_null($new_price) && $this->isCurrency($new_price)) {
        $item->setCustomPrice($new_price);
        $item->setOriginalCustomPrice($new_price);
        $item->getProduct()->setIsSuperMode(true);
    }
}

function isCurrency($number)
{
    return preg_match("/^[0-9]+(?:\.[0-9]{1,2})?$/", $number);
}


texts: How to modify "shop by" to display category

texts:
I'm trying to get the shop by filters to display a new section called category.  I managed to edit template/category/layer/view.phtml to get it to display the category section but the subcategories display all the options including subcategories, subsubcategories, and so on.  I only want to display the categories that are one level higher than the main category.  Sort of what it looks like in a dropdown navigation menu.  I've also tried several coding strategies inside template/category/layer/filter.phtml.  I've gotten close but managed to mess up the main navigation in the process.

The category filter needs to work for all product selections from the main menu, so I don't want to modify all 1800 products to add a field that contains the parent category.  I've gotten so close to getting it to work but I have problems using getLevel, and getID on certain variables.


texts: Magento 2 error: We're sorry, an error has occurred while generating this email

texts:
I am getting below error in magento 2 local system.

  We're sorry, an error has occurred while generating this email.


texts: Magento 2 not display error or success message while creating customer account

texts:
I installed Magento 2.0.0,Magento 2.0.6,Magento 2.0.7,this magento2 version installed in my localhost. I have fresh installed Magento 2.0.0,Magento 2.0.6,Magento 2.0.7 in my localhost .When I create customer an account it is not display success or error message.I do not understand why not display like this,I also clear cache and reindex but not work.In sort not working success or error message at frontend but working in backend admin panel.Any hint for that ?

Edit:
One thing I noticed if I login for customer at frontend or admin backend not generate session folder in var/ directory.


texts: Magento 2: Is it possible to add a comment in a field?

texts:
I have a custom attribute in the account information of user (backend).

Now I need to add a comment on the bottom of the field.

Code of the attribute:

$customerSetup->addAttribute(
        \Magento\Customer\Model\Customer::ENTITY,
        'mod_freetext',
        [
            'type' => 'text',
            'label' => __('Free Text'),
            'input' => 'textarea',
            'required' => 0,
            'visible' => 1,
            'user_defined' => 0,
            'system' => 0,
            'position' => 620
        ]
);

How can I do it?


texts:
How to determine whether user has registered from dedicated registration page or from checkout registration page?

When user registers through dedicated registration page customer gets registration sms but when registers while checkout sms does not goes.


texts: How to get order ID after placing order with rest API

texts:
How can we get the increment_id when you finish a order as a login customer?

I try to get the increment_id to show in a succes page but the only ID I'm receving is the order_id after I've made the /payment-information with the rest API.

My workflow is this one:

get the customer token /V1/integration/customer/token
create a cart /V1/carts/mine
add item to the cart /V1/carts/mine/items
add shipping information /V1/carts/mine/shipping-information
Add billing information and process checkout /V1/carts/mine/payment-information


texts:
How to resend the customer confirmation email  (Register) through admin panel?
Is there any options for resending?.
Please help


texts:
I want to add Mass update or Bulk update Like product updates in Magento 1.9 for custom admin grid. Could you guys please help me out.

Thanks in advance.


texts: Magento : Got Protected Data Of Customer in Observer

texts:
I tried to get the information about a logged customer into an observer, but I can't get it even when I get customer object and maybe it's because I have the "protected" data

In the Observer file:

$observer->getEvent()->getCustomer(); // works
DEBUG (7): Mage_Customer_Model_Customer Object
(
    [_eventPrefix:protected] => customer
    [_eventObject:protected] => customer
    [_errors:protected] => Array
        (
        )

    [...]
    [_isObjectNew:protected] =>
    [_data:protected] => Array
        (
            [website_id] => 1
            [entity_id] => 2

--------------------------------------------
$observer->getEvent()->getCustomer()->getData();
// Call to a member function getData() on null

How can I get the customer data?

UPDATE

I don't know if it's a good way to do it, but it works better:

$customer = Mage::getSingleton('customer/session')->getCustomer();


texts: How do I create a custom one-page checkout?

texts:
I'm currently in the process of building a booking module for a client's Magento website.

I've come to the checkout process and discovered I could (if I know how) use Magento's built in checkout classes and methods.

What I'm unsure about is how to go about this. I would need to give the user the ability to:

Either login, register or continue as guest
Input their billing details (if they choose to continue as guest)
Some completely custom fields, a mixture of both checkboxes and text inputs
Verify order and input payment information
Agree to terms and conditions before proceeding and continuing with order

I could really do with someone just breaking down how the one-page checkout process works so I can piece together how it all links.


texts: Is it possible to have a custom option for a product that, when selected, disables all the other options?

texts: Is it possible to have a custom option available for a product that, when selected, disables all the other custom options for that product?


texts:
I've created a CRON job which I want to launch once a time every day. This cron is sending me an email when it's launching.

See my crontab.xml

    <?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Cron:etc/crontab.xsd">
    <group id="default">
        <job name="custom_cronjob" instance="Portail\Cron\Cron\Test" method="execute">
            <!-- every minutes -->
            <!--<schedule>* * * * *</schedule>-->
            <!-- every days -->
            <schedule>0 0 * * *</schedule>
            <config_path>system/config/path</config_path>
        </job>
    </group>
</config>

But I'm not receiving any email.

Do I need to change the schedule ?

When I manually run cron:run group="default" my email is sended.


texts: How to place an order using vault payments via an API?

texts:
I made a custom API to create an order based on some parameters received as a JSON and using an existing saved vault payments(credit cards). From the vault_payment_token table !
So this is my script:
public function create(string $customerEmail, $items)
{
    $customer = $this->getCustomer($customerEmail);
    $store = $this->getStoreById($customer->getStoreId());

    $quote = $this->quote->create();
    $quote->setStore($store);
    $quote->setCurrency();
    $quote->assignCustomer($customer);

    foreach ($items as $item) {
        $product = $this->product->get($item['sku']);
        $product->setPrice($product->getPrice());
        $quote->addProduct($product, (int) $item['qty']);
    }

    //$shippingAddress = $this->getCustomerAddress($customer->getDefaultShipping()); // I have only virtual products - no need for shipping it !
    $billingAddress = $this->getCustomerAddress($customer->getDefaultBilling());

    $quote->getBillingAddress()->addData($shippingAddress->getData());
    $quote->getShippingAddress()->addData($billingAddress->getData());

    $card = $this->getCardDetails($customer->getId())
    $quote->setPaymentMethod($card->getData('payment_method_code'));
    $quote->setInventoryProcessed(false);
    $quote->save();

    $quote->getPayment()->importData([
        'method' => $card->getData('payment_method_code'),
        'public_hash' => $card->getData('public_hash')
    ]);

    $quote->collectTotals()->save();
    $order = $this->quoteManagement->submit($quote);
    $order->setEmailSent(0);
}

public function getCardDetails(int $customerId)
{
    return $this->paymentTokenManagement->getListByCustomerId($customerId);
}

My question is , is it enough to add the public_hash in the importData and the method to do this ? Or how else I should can approach this ? Btw I am using Adyen as payment provider and currently with the script above, I get the following feedback: 101: Invalid card number


texts: Creating a coupon code for product with custom options

texts:
I need to generate coupon codes for products with specific custom options. My sales rules have conditions for product SKU's and quantities. However, I don't know a good way to obtain the SKU for a product that has specific options. I tried the solution outlined on this site: http://inchoo.net/magento/magento-shopping-cart-promotion-rule-for-product-with-custom-options/

Unfortunately, generating SKU's in the format
[main product SKU]-[first option SKU]-...
is completely unreliable, since even the Magento test database has products with different SKU's in it. For example, an XL chealsea tee should have the SKU mtk000-XL, but the actual SKU is mtk000xl.

I understand that adding the product to the shopping cart with custom options might work, but I want to avoid using the cart for this purpose. I have access to the following data:

The product object, which is loaded by its url using the method below
The array which contains the custom options

Load item by URL:

public function getItemByUrl($url) {

    $itemUrl = str_replace(Mage::getBaseUrl(), "", $url);
    if (strpos($itemUrl, "/" === 0)) {
        $itemUrl = substr($itemUrl, 1);
    }

    $oRewrite = Mage::getModel('core/url_rewrite')
        ->setStoreId(Mage::app()->getStore()->getId())
        ->loadByRequestPath($itemUrl);

    if ($oRewrite == null) return null;

    $item_id = $oRewrite->getProductId();

    if ($item_id == null) return null;

    $product  = Mage::getModel('catalog/product')->load($item_id);

    return $product;

}

Array format:

attribute id => selected option id

For example, a medium khaki shirt has the following options array associated with it:

array(2) {
   [92]  => "28"
   [180] => "78"
}

To be clear, I only need a way to figure out the SKU that belongs to the specific product, for example, the medium khaki shirt. Once I have that, I have no problems with generating coupon codes.


texts: Get detailed rating items of review in magento 2

texts:
How can I get Detailed Rating results programatically using product id in magento 2.3.5?
I want to display it on product page.
Like this:
Product: 5 stars
shipping: 4 stars
Thanks!


texts: Magento 1.9.2 - Translation for subcategories not work

texts:
I have a problem with my subcategories listed in the category page. My site is in Italian and in English. But when I put the language in Italian it translates around the site but no for subcategories. Why?

This is the link: http://store.gadgetlab.it/estate/

Thanks for any help


texts:
Having a problem with our store now for over 1 hour. We have access to backend, but our whole front end has gone down. We've made no changes to anything,

Does anyone know of any common errors which could cause this on Magento CE 1.7

website is www.bellydeluxe.de


texts: How to display contents of a .phtml template file in checkout

texts:
I've been trying to add some php logic to view the things I want. I found out that the proper way to do this using a block template in a .phtml file in the /view/frontend/templates folder of the module.

What I've tried

In my module's layout(checkout_index_index.xml) file added this:

<referenceContainer name="content">
      <block class="DeliveryMatch\Shipping\Block\DmCarrier" name="dm-shipping" template="DeliveryMatch_Shipping::checkout/shipping/carrier_custom.phtml" before="shippingAdditional" cacheable="false" />
</referenceContainer>

To display the contents of the .phtml before shippingAdditional

  app/code/DeliveryMatch/Shipping/Block/DmCarrier.php

<?php
namespace DeliveryMatch\Shipping\Block\DmCarrier;

use Magento\Framework\View\Element\Template;

class DmCarrier extends \Magento\Framework\View\Element\Template
{

    public function __construct(Template\Context $context, array $data = array())
    {
        parent::__construct($context, $data);
        $this->setData('contacts',array());
    }

}

And the .phtml file in

  view/frontend/templates/checkout/shipping/carrier_custom.phtml

<?php echo 'Test'; ?>

But this is not displayed in the checkout.

What I need

Display the contents of

  templates/checkout/shipping/carrier_custom.phtml

Inside the shippingAdditional field

How do I achieve this?

Thanks in advance


texts: Security Patch SUPEE-7405 - Possible Problems?

texts:
It's time for another patch day, SUPEE-7405 for Magento 1.x is out and the list of fixes is long: https://magento.com/security/patches/supee-7405

After the experience with the last patches, I have to ask again: what are the possible problems when applying the patch and what do I need to consider?

Lots of XSS issues were fixed again, so I expect to patch custom themes manually. Anything else? Are there backward incompatible changes?


texts: Magento2 use backend setting to apply custom layout in module

texts:
I have written a module that has a settings page in the backend.
The Module overrides a layout.xml file and uses a modified template by editing my own template path

view/frontend/layout/customer_account_create.xml

in this line of the layout file:

<block class="Magento\Customer\Block\Form\Register" name="customer_form_register" template="form/register.phtml">

But I would like to override this layout file only if the backend settings for this module is set to enabled.

I know I can add some code in the template I override to check for the setting before doing my modifications, but is there another way?


texts: How to fix 404 page in Magento 2.2 - 2.3.4 versions Advanced reports? If you see the status pending in the configurations, and the user for advanced reports is absent.


texts:
I have tried this on a clean install of magento 2.4.1
I then went to a magento 2.3.6 ran grunt exec and grunt less both worked
After upgrading the 2.3.6 to 2.4.1 the grunt exec then failed with the same error as the clean 2.4.1
Im running MAMP Pro on mac os
Running "exec:blank" (exec) task
Running "clean:blank" (clean) task

405 paths cleaned.

Done.
Execution Time (2021-02-05 16:40:48 UTC-0)
loading tasks   49ms  ▇▇▇▇▇▇▇▇▇▇▇ 22%
clean:blank    167ms  ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 77%
Total 218ms

Exited with code: 255.
Error executing child process: Error: Process exited with code 255.
Warning: Task "exec:blank" failed. Use --force to continue.

Aborted due to warnings.
Execution Time (2021-02-05 16:40:47 UTC-0)
loading tasks  82ms  ▇▇▇▇ 7%
exec:blank     1.1s  ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 93%
Total 1.2s
bin/magento deploy static content methods work without error


texts: Free Shipping Incentive - "Just € xx,- left till free shipping!"

texts:
I'd like to show a "Free Shipping" Incentive in the cart so that customers now that they have to add a certain amount to receive free shipping.
I work my free shipping with table rates and not the free shipping module.

I found this script but unfortunately its not really working. Any idea how I can get something like this to work?

<?php if ($this->getQuote()->getSubtotal() < 100): ?>
<?php $subtotalamt = $this->getQuote()->getSubtotal(); ?>
<?php $freeshipamt = 100; ?>
<?php $sumtotal = $freeshipamt - $subtotalamt; ?>
<?php Mage::helper('checkout')->formatPrice($sumtotal); ?>

You are just $<?php print ($sumtotal); ?>
away from earning free shipping!

<?php endif ?>

It should read the Cart Total incl. tax and then just show the difference to the price I define.

Thanks

Edit: I inserted the script in /app/design/frontend/theme/default/checkout/cart_new.phtml (my cart template)
and tried to get it working there. It should then show the sentence:
"You are just $XXX,- away from earing free shipping!"

But unfortunately it is not showing anything at all.


texts: Magento 2.2.5 shows webserver ip in sales

texts:
When I see at a sale - customer IP, it shows my web server IP in all the costumers ip.
How to change so I see the costumers IP in the sales and not server's IP?

Thanks


texts: Magento makes use of properties in a non PHP native way. Where is that hard coded?

texts:
Examples are abundant: Mage::getSingleton('core/layout');

While the method takes 2 arguments separated by a comma. Not in the above example.

What turns 'core/layout' into $arg1,$arg2?


texts: Magento 2 language changes not working properly, Only works for first time when i switch

texts:
Languages not switching properly. Only works when language parameter www.website.com/?___store=german exits into the url but when i click on the other pages then usually parameter will be removed from url then it's not working.

Any idea guys ?

Thanks in advance!


texts: Remove static block using xml from header.phtml

texts:
In my header.phtml I've got the following code

<?php
    echo  $this->getLayout()->createBlock('nwdrevslider/revslider')->setAlias('slidername')->setBlockId('sliderid')->toHtml();
?>

So I want to remove it from the product view page so to do so in my catalog.xml I've write the following code

<catalog_product_view translate="label">

    <reference name="header">

       <remove name="slidername" />

        <!-- even tried following but didn't work -->

        <remove name="sliderid" />

        <!-- even tried following but didn't work -->

        <action method="unsetChild"><name>slidername</name></action>

        <!-- even tried following but didn't work -->

        <action method="unsetChild"><name>sliderid</name></action>

    </reference>

</catalog_product_view>

Using Magento 1.7.0.2.

Let me know if you want more information.

Revolution slide is been used


texts: Magento 1.9 add layout and template to custom module in admin

texts:
When I try to create a custom module that shows two tabs on the main page with the option to change titles, backgrounds, and colors, I was successful in adding the module's tab in the admin area but wasn't able to add the layout and template.
any one can explain please , how i can do this?
here the xml files:
app/etc/modules/Lern_Sample.xml/
 <?xml version="1.0"?>
<config>
<modules>
    <Lern_Sample>
        <active>true</active>
        <codePool>local</codePool>
        <depends>
            <Mage_Adminhtml />
        </depends>
    </Lern_Sample>
</modules>

app/code/local/Lern/Sample/Block/Adminhtml/Sample/
grid.php
 `class Lern_Sample_Block_Adminhtml_Sample_Grid extends
 Mage_Adminhtml_Block_Widget_Grid
  {
    public function __construct()
  {
       parent::__construct();

  }
 }`

Sample.php
   class Lern_Sample_Block_Sample extends Mage_Payment_Block_Form
   {
      public function __construct() {}
   }

app/code/local/Lern/Sample/controllers/Adminhtml/IndexController.php
   class Lern_Sample_Adminhtml_IndexController extends
 Mage_Adminhtml_Controller_Action {

   public function indexAction() {

      $this->loadLayout();
      $this->renderLayout();

   }
}

design/adminhtml/default/default/layout/sample.xml
        <?xml version="1.0"?>
         <layout version="0.1.0">
          <lern_sample_index_index>
           <reference name="root">
             <action method="setTemplate"><template>page/1column.phtml</template></action>
            </reference>
           <reference name="content">
            <block type="Lern_Sample/index" name="Lern_Sample_index" template="sample/sample.phtml"/>
           </reference>
          </lern_sample_index_index>
         </layout>

design/adminhtml/default/default/template/sample.phtml
Hello World
config.xml
       <?xml version="1.0"?>
    <config>
     <modules>
    <Lern_Sample>
        <version>0.1.0</version>
    </Lern_Sample>
</modules>
<frontend>
    <routers>
        <sample>
            <use>standard</use>
            <args>
                <module>Lern_Sample</module>
                <frontName>sample</frontName>
            </args>
        </sample>
    </routers>
</frontend>
<admin>
    <routers>
        <sample>
            <use>admin</use>
            <args>
                <module>Lern_Sample</module>
                <frontName>admin_sample</frontName>
            </args>

        </sample>
    </routers>
</admin>
<global>
    <helpers>
        <sample>
            <class>Lern_Sample_Helper</class>
        </sample>
    </helpers>
</global>
<adminhtml>
    <menu>
        <sample module="sample">
            <title>Sample Module</title>
            <sort_order>100</sort_order>
            <children>
                <sample module="sample">
                    <title>Sample Module</title>
                    <sort_order>0</sort_order>
                    <action>admin_sample/adminhtml_index</action>

                    <layout>
                        <lern_sample>
                            <file>lern_sample.xml</file>
                        </lern_sample>
                    </layout>
                </sample>
            </children>
        </sample>
    </menu>
</adminhtml>


texts:
So I am running a Magento 1.x platform for an organization which is heavily focused on the organic indexation for google.

Our site audit tool is telling me that the following pages have a duplicate Meta descriptions

  www.site.com/customer/account/login
  www.site.com/checkout/cart
  www.site.com/customer/account/forgotpassword

These pages clearly aren't CMS pages so I was already looking in the root folder on my FTP browser if I could find some phtml files that I could fill in the meta descriptions.

I haven't found the files yet so here's my question:

1: In which folders would these be located?

2: Should I do it this way or would there be another method of adjusting to the CMS?

Note: This is a Magento 1.9 installation with a Wordpress integration


texts:
In Magento 2 after clearing all files:

Remove pub/static
Remove var/cache
Remove var/composer_home
Remove var/generation
Remove var/page_cache
Remove var/view_preprocessed

when enabling developer mode. why its still try to load files from pub/static?

and even if files are in pub/static but when i am trying to open a css file its showing 500 error. But same file is accessible in production mode. Even in development mode when i am changing anything in phtml file under theme why its does not updated in developer mode ?


texts: Magento 2 js bundling - exclude certain script

texts:
We got M2E pro installed on Magento 2.1.1. After enabling js Bundling under Config > Developer we have a not defined error on all m2e pro js.

Wondering is there any way how to exclude M2E pro related js from bundling? Or is it possible to bundle js only on frontend and exclude backend?

I tried to add following item to exclude list in theme::view.xml, but that did not work

<item type="directory">app/code/Ess/M2ePro/view/adminhtml/web/js</item>

Any advice will be much appreciated.


texts:
I was able to successfully add new order field through an install script:

$installer->addAttribute('order', 'is_local', array('type'=>Varien_Db_Ddl_Table::TYPE_SMALLINT, 'default'=>1));

However, I could not update the "default" property of it, let's say default=>0. One suggested to use updateAttribute() https://stackoverflow.com/questions/10420199/magento-module-setup-change-product-attribute-to-not-required but it doesn't work in order table.

Thank you.


texts: I am working on one custom module and i need child categories when any ID is clicked. Loading is handle by ajax. I am not aware of ajax in Magento 2. Can anybody give me small demo of ajax in Magento 2..


texts: Magento 2 admin auth panel not displaying

texts:
I have been trying to find a solution to this error for nearly 2 hours now in vain.

I recently downloaded Magento 2 and set it up in my localhost windows.

When I go to my admin page, the sign in panel which is supposed to display (from tutorials I've watched) isn't displaying, instead I'm only getting this plain color background.

the default store front (localhost/magento/) shows up with the basic header and footer with the message "CMS homepage content goes here."

Has anyone had the same issue/is familiar with this issue? If so, help would be much appreciated.

Thank you,

Tim


texts: size chart not display after easy tab on product view page

texts:
I would  like to show size chart after easy tab Block now its showing in easy tabs but when I call it out of block  easy tabs By
this Code

<?php echo $this->getLayout()->createBlock('core/template')->setTemplate('catalog/product/view/sizechart.phtml')->toHtml(); ?>

its Showing Source Code.
how can I call it from out  easy tab Block ?


texts: change the default currency based on customer geo location - Magento 2.3.2

texts:
How to set currency depending on country's IP, means if customer browse my site from us location then the current currecny and language should be USD & en_US or if customer browse my site from Canada location then it should be CAD & en_CA through out the site. My Default Currency is 'USD'.

Is there any free extension in magento 2?

How can i achieve this? Any ideas?

Thanks in advance...!!!


texts:
I'm exploring the Magento 2 CLI and I don't know how could I apply the command below in real life?

bin/magento dev:xml:convert

Can you show me some example?

Thanks!


texts: Getting undefined index sampleData when trying to use generate:tests command in MFTF

texts:
I am working to use MFTF, it went well upto build:project and changes in .env file but when trying to generate tests I am getting ERROR

Undefined index: SampleData
in C:\xampp2\htdocs\magento2\dev\tests\acceptance\vendor\magento\magento2-functional-testing-framework\src\Magento\FunctionalTestingFramework\Util\ModuleResolver.php:309

I am using magento 2.2.6.
Complete details regarding can be found on :

https://github.com/magento/magento2-functional-testing-framework/issues/312


texts: How can i get automatic sale category in my magento?

texts:
How can i get automatically sales category in my Magento ?
i want to add like this....

Is there any possibility's from back end? and is there any free module for this?


texts: When to extends Magento Framework Action

texts:
I have seen a sample module with a class like following.

My question is:
1) Why do it need to extends \Magento\Framework\App\Action\Action since $context is not used in execute?
2) Why parent::__construct($context) and not parent::__construct($context, $session, $order)

class SampleClass extends \Magento\Framework\App\Action\Action
{
    protected $order;
    protected $session;

    public function __construct(
        \Magento\Framework\App\Action\Context $context,
        \Magento\Checkout\Model\Session $session,
        \Magento\Sales\Model\Order $order,
    )
    {
        $this->session = $session;
        $this->order = $order;
        parent::__construct($context);
    }

    public function execute()
    {
        // execute code here
    }
}


texts: how to track Magento 2 admin updates for development?

texts: I am new to Magento 2. On Magento 1, we can use something called mageploy. Mageploy helps us to record actions for admin configurations, cms pages, cms blocks, and other, then when other developer pulls the codes and executes the command, they will get the same updates.


texts:
We have add subcategory listing in home page, see picture:

The all menu is centered to the complate page, it is possible to center the 3 subcateogry, see picture:

We can provide css and/or phtml.

Thanks!


texts:
I want to remove some XML value without touching core XML files, is it possible ?

The scenario is the following.

In /app/code/core/Mage/Tax/etc/config.xml we have some config value for the totals (<sales><quote><totals>).
I want to comment out the tax one so the tax line is not displayed in the frontend.

commenting the node in the core XML file works fine but it is not the best approach.
If I have put new empy values in a separate module I have a different effect ( it is not like remove the declaration)

In particular I want to do something like:

<!--<renderer>tax/checkout_tax</renderer>-->


texts: Add new field to user info in admin account

texts:
I need to add a custom field to the user account information while creating a user under

system > permission > user > add new user

I need to add a "location" field along with firstname, lastname, email and password fields.

how can I do this?


texts: I want to allow users to search by certain attribute values, for example color and brand

texts:
I am trying to programatically retrieve a list of products using name attribute. I want to allow users to search by certain attribute values for example color and brand using ajax.

Here is my code

<?php
require_once 'app/Mage.php';
umask(0);
ini_set('display_errors', 1);
ini_set('max_execution_time', 3600);
Mage::app();
Mage::getSingleton('core/session', array(
    'name' => 'frontend'
));
$product_search = $_REQUEST['term'];
if ($product_search) {
    $productCollection = Mage::getModel('catalog/product')->getCollection()->addAttributeToSelect('name')->addAttributeToFilter(array(
        array(
            'attribute' => 'name',
            'like' => '%' . $product_search . '%'
        )
    ))->addAttributeToSelect('price')->addAttributeToSelect('thumbnail')->joinField('qty', 'cataloginventory/stock_item', 'qty', 'product_id=entity_id', '{{table}}.stock_id=1', 'left');

    $imageHelper = Mage::helper('catalog/image');
    foreach ($productCollection as $_product) {
        $thumbail_src = "";
        $url          = $_product->getProductUrl();
        $data         = '
 init($_product, 'thumbnail')->resize(50, 75) . '">

' . $_product->getName() . '

' . $_product->getPrice() . '
 ';
        $respones[]   = array(
            'id' => $_product->getId(),
            'name' => $_product->getName(),
            'data' => $data,
            'price' => $_product->getPrice(),
            'qty' => $_product->getQty()
        );
    }

    echo json_encode($respones);
}

?>


texts: How to change the search box in Magento 2.2.4?

texts:
I tried to move the search box to right and all categories to left. But where can i find the code in Magento 2.2.4 .

Please check the above image


texts: Adding a new Customer Group Programatically

texts:
I would like to know if it is possible from a public function to create a customer group? I would like, in my saveNewGroup function to crate a new customer group. I saw another example online but it was in a setup class and i cannot get it work

This is my class :

<?php

namespace XX\XX\Controller\Adminhtml\Index;

class SaveNewCustomerGroup extends \Magento\Backend\App\Action
{
    protected $_resource;
    protected $_productRepository;
    protected $_customerGroupsCollection;

    public function __construct(
        \Magento\Backend\App\Action\Context $context,
        \Magento\Framework\App\ResourceConnection $resource,
        \Magento\Catalog\Model\ProductRepository $productRepository,
        \Magento\Customer\Model\ResourceModel\Group\Collection $customerGroupsCollection
    ) {
        $this->_resource = $resource;
        $this->_productRepository = $productRepository;
        $this->_customerGroupsCollection = $customerGroupsCollection;
        parent::__construct($context);
    }

    //Every time the controller is called this function is executed
    public function execute(){
        $groupName = $this->getRequest()->getParam('customergroup_name');
        $taxId = $this->getRequest()->getParam('customergroup_taxid');

        echo json_encode($this->saveNewGroup($groupName, $taxId));
    }

    private function saveNewGroup($groupName, $taxId){
        if($groupName == null || $groupName == ""){
            return 'Error: Please enter a group name.';
        }
        else{
            return $groupName . " has been created successfully.";
        }

    }

}
?>


texts: Create order of 'Bundle Product' programmatically with options selection: Magento 2

texts:
I am new to Magento tried several solutions but I could not create orders with 'Bundle Product' by specifying selection options.
Even though if it is an API solution, it may be helpful for me,
I will modify it as needed.


texts: Magento 2: Disable custom product attribute editing?

texts:
I have a custom product attribute called blacklisted, which indicates if a product is currently blacklisted. This is controlled by a cronjob and shouldn't be edited by an admin. It however should be visible to an admin on the product edit page.

Maybe there is a way to implement a new frontend_input type?

Any tips on how I can achieve this?


texts:
I'm reviewing someone's code that loads, does something to it, and saves it.

$review = Mage::getModel('review/review')->load($id);
...
$review->setWebsiteId(0);
...
$review->save();

When a review object is loaded, there is no website ID, and the tables don't, either. I'm wondering if this is required or not. The reviews seem to get saves just fine without it. Any ideas?


texts:
I have experience with composer, PHP, Homestead and ScotchBox.
This is my first Magento setup so I'm totally experimenting.
I have a Magento 2 store file that i worked on for a while and I want to mitigate from using MAMP to vagrant box.
I have built a box using
https://github.com/paliarush/magento2-vagrant-for-developers

I replaced folder of default magento2ce installation with my store files but it is not working .
what exact environment variables that I'm missing for my store to work properly?


texts: Is there a way to add an endpoint on magento without creating a new module?

texts:
I'm trying to add in a single file on the root folder
something than given a sku or id (it can be either get or post)

it will return me the stock as plain text.

I'm trying to figure out if there is a way to do something like.

$products=Mage::getModel('catalog/product')->getCollection();
foreach($products as $_product){
$stock = Mage::getModel('cataloginventory/stock_item')->loadByProduct($_product);
echo $stock->getQty();
echo $stock->getMinQty();
echo $stock->getMinSaleQty();
}

but this file isn't connected to Magento

sorry for the bad english,


texts: Magento2 : How to disable product image slider on detail page?

texts:
I want to disable product image slider on product detail page, only in desktop and tablet view. also all product images visible in same.

other all images functionality must work like images open in full screen.

Display All images vertically at the same time. show all images one by one in vertical order.

Note: Only disable slider which is displayed only one product image.


texts:
Is there a comprehensive list available that shows all available parameters for coding blocks?

For example for a product list. There is the category_id parameter and the column_count parameter, but what other parameters can I use?


texts: How to hide if text attribute value = blank?

texts:
Script:

Delivery: FAST & FREE

Output:

Delivery: FAST & FREE
Between Sun Mar 19 2017 06:35:17 GMT+0530 (India Standard Time) & Mon Mar 20 2017 06:35:17 GMT+0530 (India Standard Time)

How to hide the front end output if the attribute shipout_day_from is blank?


texts:
We have a customer move their servers to a new host and we had one days' data which got missed in between, while we have synchronized products and customers, new orders had already been taken and now the customer wants to find out if it would be possible to modify the order number to follow the old sequence.

I am aware of the table(eav_entity_store) that contains the last order id and the increment values which can avoid issues happening in future with order numbers, however we are trying to modify order numbers from the past.

Is there a list of tables, that I can update to achieve this result. I know modifying database directly is a very bad idea, but the for the customer it is a major issue as the orders integrate with their accounting system and it cannot take duplicates.


texts:
Hi i have custom module with image how to add thumbnail slider for this

        <?php $collection = Mage::getModel('fanbook/fanbook')
        ->getCollection()
        ->addFieldToFilter('status', array('eq'=>'1'));

                foreach($collection as $child){
                    $mediaurl=Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA);
                    $value =$child->getImg();?>

                            <?php echo ''; ?>

                <?php }
        ?>


texts:
How do we get Magento 2.2.2 migration (from 1.9.2.1) to skip the checks below, so that we can move past these errors?

2017-12-15 15:19:24][ERROR]: Class ultramegamenu/category_attribute_source_categorylabel does not exist but mentioned in: eav_attribute.source_model for attribute_id=137

[2017-12-15 15:19:24][ERROR]: Class ultramegamenu/category_attribute_source_dropdown_type does not exist but mentioned in: eav_attribute.source_model for attribute_id=167
[2017-12-15 15:19:24][ERROR]: Class ultramegamenu/category_attribute_backend_grid_columns does not exist but mentioned in: eav_attribute.backend_model for attribute_id=169
[2017-12-15 15:19:24][ERROR]: Class ultramegamenu/category_attribute_source_dropdown_columns does not exist but mentioned in: eav_attribute.source_model for attribute_id=170
[2017-12-15 15:19:24][ERROR]: Class ultramegamenu/category_attribute_backend_dropdown_blocks does not exist but mentioned in: eav_attribute.backend_model for attribute_id=171
[2017-12-15 15:19:24][ERROR]: Class seo/system_config_frontend_category does not exist but mentioned in: eav_attribute.frontend_model for attribute_id=201
[2017-12-15 15:19:24][ERROR]: Class seo/system_config_source_category does not exist but mentioned in: eav_attribute.source_model for attribute_id=201
[2017-12-15 15:19:24][ERROR]: Class seo/system_config_source_metarobots does not exist but mentioned in: eav_attribute.source_model for attribute_id=202
[2017-12-15 15:19:24][ERROR]: Class seo/system_config_source_canonical does not exist but mentioned in: eav_attribute.source_model for attribute_id=205
[2017-12-15 15:19:24][ERROR]: Class ultramegamenu/category_attribute_helper_grid_columns does not exist but mentioned in: catalog_eav_attribute.frontend_input_renderer for attribute_id=169
[2017-12-15 15:19:24][ERROR]: Class ultramegamenu/category_attribute_helper_dropdown_blocks does not exist but mentioned in: catalog_eav_attribute.frontend_input_renderer for attribute_id=171


texts: How update on save indexing works in magento?

texts:
In enterprise 1.14 version of Magento, we are using flat tables and reindexing is achieved by cron job and from command line i.e  php indexer.php reindexall. But when I am trying the "update on save" option for reindexing, indexing process is not working when a product is saved. Why it is so? Which methods are responsible for the update on save indexing process and how I can debug this.

Thanks


texts: Possible to split item over 150lbs (ups) into smaller boxes to calculate shipping?

texts:
I have come across an issue where we cannot calculate shipping on an item over 150lbs.

I first have tried the solution outlined here http://www.magentocommerce.com/boards/viewthread/179546/#t234403
(set max. package weight -150lbs and Packages request type - divide to equal weights)

Now this works for an entire cart of multiple items.  For example if you have a cart with 2 items and a total weight of 160lbs, it will split the cart into separate boxes and give a rate.  However if you have one item in a cart at 160lbs it will simply not calculate.  Does anyone know how to make it split a single item that is over 150lbs and give a rate?


texts:
I am trying to fill-in the information of a product category in Magento v.1.9.4.1, however, I am unable to locate or figure out how to add an additional option under this "Dropdown" menu

I was able to locate the options content by going to CMS > Static Blocks, however, when I tried to add another option, it won't reflect in the dropdown.

My questions is, how do I connect it or how do I add an option under the dropdown? Is there a way to do it in the Magento admin dashboard? Please help.


texts: site wide update url to secure in magento 1

texts:
I have a question can you help me about this one. I want a site wide update of url to secure url in the site in magento 1. SSL is already installed.

can you please teach me the proper process.

Thanks,
MazeStricks


texts: Difficulty with different pricing on configurable products with 2 or more configurable attributes

texts:
I'm having a problem with pricing a configurable product (CP) with 2 (or more) configurable attributes (CA), where all of the associated simple products (SP) have unique prices.

When there is only one CA, the super product attribute configuration (SPAC) can be used to offset the prices to provide accurate pricing for each of the SP associated to this CP. However, there is a dependency introduced between the CA options when there are more than one CA and when each of the SPs has unique prices, whereas the SPAC price adjustments, whether by a fixed or percentage amount, are independent of the CA; assigned price offsets are per CA. The result is that it's impossible to use these offsets to match the unique pricing of the SPs. Note that the term unique is key here; some non-unique pricing of the SPs can be achieved with this method.

Has anybody worked with a problem like this? Now, it does seem that an extension that allows simple product pricing to be used could solve this problem, but I already have two product-related extensions running on this instance, so I'd like to avoid installing another one, if possible.

Right now, the only solution I can think of, besides using another extension, is to break up this product, so that it has only one CA. Any feedbacks are greatly appreciated. Thanks, and happy new year!


texts: How to remove a mass action in dropdown when it is disabled in configuration?

texts: I create a new mass action and I try to remove it when it is disabled in configuration


texts: How to show all cart items in phtml file Magento 2?

texts:
What is the best way to show all the items/products that are in checkout/cart in a PHTML page?

I have added a custom phtml page that shows some products, and also have a phtml page that want to show all the products that the visitor/user have added to cart.

Thank you


texts: Magento 2: How to extend Customer Address Form in front end and show modal?

texts:
I want to add an ability to Save Address on Customer Address form to validate the address. I have no idea on how to extend this. Once Customer clicks on saving address

Save Address -> Intercept -> Show Modal -> Save Address(based on option selected)

I want to intercept that and massage the address and then save the address. Give customers ability to choose between entered and address and my address.


texts: Add Text Area to product page for all products

texts:
I know that we can use custom options to add form fields to a specific product page on frontend, but i want a textarea which should be displayed on front for all products on the product page.Currently using custom options will require to create it for all products, but i was such an option which is shown at front end automatically. When a customer enter any data to that textarea, that data will be shown in the order information, just like the custom options.

Any help and idea will be appreciated.

Thank you


texts:
I edited our homepage but every next day all links  disappear. When I add them and save the page it's ok but then the next day they disappear again. Is this some kind of bug? How can we solve this?
Thanks.


texts: Create dropdown/select box in magento system.xml for payment/shipping configuration

texts: How to create dropdown/select box in magento system.xml for payment/shipping configuration


texts:
I have 2 shop and 2 same themes for both the Stores

1: abc.com with theme Custom/Theme1

2: xyz.com with theme Custom/Theme2

abc.com load fine, but xyz.com does not load template and layout, t config in the backend like this but it not work. Please help me


texts:
I'm working on a magento community 1.8.0.1 shop. During the development of an extension, I noticed that other extensions with cron job configured weren't running when I hit cron.php.
I tried to troubleshoot the problem through magento files, but I got stuck in the /lib/Varien/Profiler.php file.

I tried to disable my current development (via configuration > system > advanced, and via xml file), checked php and magento error logs before going on debug through magento files, now i'm getting stuck, I don't know where to start to troubleshoot this issue. The cron worked like a charm for a long time, I just don't know why and when it stopped working.


texts: Magento contact form submit button allow click ones

texts:
Is it possible to change the behavior of the submit button on the contact form, so that it will only allow to click one time?

Now when you fill in the form and click multiple times on the submit button, it wil sent the contact form and email multiple times.

Is there a way to reduce this to only 1 time?

We are running Magento 1.9.3.9


texts:
I want to add brands list under footer:

Can anyone help?


texts: Inserting multiple CMS blocks into a product collection

texts:
My objective is to allow CMS blocks to be added to a category's product collection at various places via the visual merchandiser.

I created a custom table which is similar to catalog_category_product except referencing categories and blocks with a relevance/position field, and have created some dummy data with a position that might look like this:

1: Product 1, 2: Product 2, 3: Block 1, 4: Product 3, 5: Block 2

I.e. three products and two blocks forming five entities.

I am interested to know whether I can swap the product collection that categories use by default out for a custom Varien_Data_Collection (_Db?) containing both products and CMS blocks together. If this is possible, I could then hopefully pass the Frankenstein collection into the "toolbar" pager and have it correctly perform pagination as per normal for the category pages.

Question: Is it possible to have a collection containing multiple entity types?

The reason I'm looking at doing this is that the pagination won't really work correctly unless I pass it a final entity collection to paginate. E.g. If my first page had 5 products and 3 blocks and I set the page size to 5 to prevent 8 products from loading then the next page would then load 5 products, but it may actually need to load 8 products if no static blocks exist in the page.

I'm having a surprising amount of luck by creating "fake products" in the collection with an observer like so:

/** @var Mage_Cms_Model_Resource_Block_Collection $blockCollection */
foreach ($blockCollection as $block) { /** @var Mage_Cms_Model_Block $block */
    $frankensteinProduct = $productCollection
        ->getNewEmptyItem()
        ->addData($block->getData())
        ->setData('product_or_block', 'block')
        ->setData('entity_id', 'block_' . $block->getId());

    $productCollection->addItem($frankensteinProduct);
}

Is this the right approach to be taking?


texts: I am using Magento 1.9.2.2 and I added configurable product but the problem is it is not reflecting it's child product price. and sometimes images are also not reflecting while selecting a color. I added all the simple product images to the configurable product.


texts: Unableto verify site on Magento Security Scan

texts: I am trying to verify my site on the Magento new security scanner https://account.magento.com/scanner/index/form/ but every time I try to verify I get an error  Unable to verify this site. Please recheck your verification code and try again! I am using domain name and HTML Comment. I cannot see the code in my source when I put the code on my site which I believe that's why it can't be verified. How can I resolve this issue please. I know this question was asked here but I did not find my answer.


texts: Magento 2 : mocking `getParam()` in unit test not working

texts:
I'm breaking my head for hours now over a simple thing I've done hundreds of times: mocking another model. Can anyone see what's wrong with this?

$mockedRequest = $this
    ->getMockForAbstractClass(\Magento\Framework\App\RequestInterface::class);
$mockedRequest
    ->method('getParam')
    ->will($this->returnValueMap([['a', 'b']]));

var_dump($mockedRequest->getParam('a'));

You would expect the result to be b right? WRONG! It returns NULL! And I can't for the love of God figure out why...

If anyone can point me in the right direction I would be so happy... It's probably a small thing, but I can't see it ...


texts:
http://localhost/testsetup/index.php/inquiry/index/index

echo "<pre>"; print_r($data); die;

Array
(
    [qty] => 1
    [product] => 486
)

Case 1.
When i press ctrl+f5 (reload the inquiry page) , Array data is there.
This is ok for me.

Array
(
    [qty] => 1
    [product] => 486
)

case 2.
Array data is empty. When i hit the URL of page.

 Array
    (

    )

How to solve case 2 so that array data is not empty when i hit the URL.


texts: How to show checkout price summary in shipping step Magento 2?

texts:
The checkout sidebar cart summary with the price is displayed on at payment step, I want to show them on the shipping step as well. is there any solution to do this?

Screenshots

Here I want to show:

This section:


texts: New order email confirmation not received in Magento

texts: In Magento I have not received any order confirmation email when I completed an Order in Magento 1.9.1


texts:
Hi i've tried to login the admin dash with the user/password
but unable to login to magento connect using the same credential ,
even tried to add another administrator user but unable to login.
The error is when i login @ the downloader page ,
it will reload to the same downloader login page with this error downloader/index.php?A= at the address bar...
any kind soul able to assist?


texts: How to override preprocessed CSS element which is !important

texts: The preprocessed css [/public_html/var/view_preprocessed/pub/static/frontend/Vendor/Theme_custom/en_US/css] is overriding my custom css file because it have !important. It happens only on the large screens. How to fix it?


texts: Magento 2 - How to call sales_order_save_after Observer manually for testing?

texts:
i have a working Observer on the event sales_order_save_after.
The Observer looks like this:

namespace Company\ExportOrder\Observer;
use Magento\Framework\Event\ObserverInterface;

class Observer implements ObserverInterface {

    protected $connector; public function __construct() {
        $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
    }

    public function execute(\Magento\Framework\Event\Observer $observer) {
        $order = $observer->getEvent()->getOrder();
        $orderId = $order->getId();
        $customerId = $order->getCustomerId();

        // do something
    }
}

How am i able to call this Observer manually for testing? I don´t really want to create orders again and again. Idea is something like this:

$model = $objectManager->create('\Company\ExportOrder\Observer\Observer');
$model->execute();

But the execute-Function expects the Observer Model, and how can i set the order id manually for testing the function?


texts:
I'm trying to add some new fields/attributes to "Customers Main File" in the export settings to CSV. I've seen a free module that does something similar but for products only. https://bsscommerce.com/magento-2-custom-product-attribute-export-extension.html
Can anybody help me get started or point me in the direction to get started with a good tutorial?


texts: Magento1.9: How can i add image of product using soap api

texts:
i have use this code:

$proxy = new SoapClient('http://magentohost/api/soap/?wsdl');
$sessionId = $proxy->login('apiUser', 'apiKey');

$productId = 2;
$file = array(
    'content' => '/9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAIBAQIBAQICAgICAgICAwUDAwMDAwYEBAMFBwYHBwcGBwcICQsJCAgKCAcHCg0KCgsMDAwMBwkODw0MDgsMDAz/2wBDAQICAgMDAwYDAwYMCAcIDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAz/wAARCAAXABcDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwDLooor8XP4DCiiigAooooAKKKKAP/Z',
    'mime' => 'image/jpeg'
);

$result = $proxy->catalogProductAttributeMediaCreate(
    $session,
    $productId,
    array('file' => $file, 'label' => 'Label', 'position' => '100', 'types' => array('thumbnail'), 'exclude' => 0)
);

but image not added in product ,,
can any one guide me how can i add images with products using soap api ?


texts: Why php code is getting cached in Magento 2 listing page?

texts:
I have built in full page cache enabled in Magento.

I have added following code in app/design/frontend/Vendor/Module/Magento_Catalog/templates/product/list.phtml which shows whether an item is already in wishlist or not

<?php $wishlistHelper = $this->helper('Magento\Wishlist\Helper\Data');
// other code
foreach ($_productCollection as $_product):
$_in_wishlist = false;
    foreach ($wishlistHelper->getWishlistItemCollection() as $_wishlist_item){
        if(($_product->getId() == $_wishlist_item->getProduct()->getId()) && $customerLoggedin) {
             $_in_wishlist = true;
        }
       }
var_dump($_in_wishlist);
endforeach;
?>

Now I have some code on the same page which adds product to wishlist via Ajax call which works fine.

If I reload the page after product is added to wishlist, above code shows bool(false) but when I clean cache by running bin/magento cache:clean it shows the correct value which is bool(true).

Why this code is getting cached and how to fix it?


texts: How to Override Payment Helper Data Method Magento 2?

texts:
I am trying to override Magento Payment Helper data in my extension but it's not working.

I have overriden by using the preference method.

I have put below code in app/code/Demo/PaymentTest/etc/di.xml

<preference for="Magento\Payment\Helper\Data" type="Demo\PaymentTest\Helper\Data" />

Here is my Helper code

<?php
namespace Demo\PaymentTest\Helper;
class Data extends \Magento\Payment\Helper\Data
{
    public function getStoreMethods($store = null, $quote = null)
    {
    }
}

I am trying to override getStoreMethods method in my helper but it's not calling it.

Can you please tell me what am I doing wrong?


texts: Some of the pages in admin Dashboard not loading, received Error in magento 2.0.6

texts:
Catalog page not loading in admin dashboard of Magento 2.0.6.

Please see the error message below:

  Warning: Magento\Framework\Locale\TranslatedLists::getCountryTranslation(): Cannot load resource element 'AN' in vendor\magento\framework\Locale\TranslatedLists.php on line 206

Please help me to resolve the same.


texts: Select from other column if primary column is empty (coalesce)

texts:
I try to extend Abandoned Carts report. In order to do that I need to modify a query that is used to populate the grid. I can't prepare coalesce condition using Varien_Db_Select.

Now there is:

// Mage_Reports_Model_Resource_Quote_Collection::addCustomerData($filter = null)
$this->getSelect()
    ->joinLeft(
        array('cust_email' => $attrEmailTableName),
        'cust_email.entity_id = main_table.customer_id',
        array('email' => 'cust_email.email')
    )
//...
$this->_joinedFields['email']         = 'cust_email.email';
//...

// Mage_Adminhtml_Block_Report_Shopcart_Abandoned_Grid::_prepareColumns()
$this->addColumn('email', array(
    'header'    =>Mage::helper('reports')->__('Email'),
    'index'     =>'email',
    'sortable'  =>false
));

This is the query:

SELECT `main_table`.*, (main_table.base_subtotal_with_discount*main_table.base_to_global_rate) AS `subtotal`, `cust_email`.`email`, `cust_fname`.`value` AS `firstname`, `cust_mname`.`value` AS `middlename`, `cust_lname`.`value` AS `lastname`, CONCAT_WS(' ', cust_fname.value, cust_mname.value, cust_lname.value) AS `customer_name`
FROM `sales_flat_quote` AS `main_table`
LEFT JOIN `customer_entity` AS `cust_email` ON cust_email.entity_id = main_table.customer_id
LEFT JOIN `customer_entity_varchar` AS `cust_fname` ON cust_fname.entity_id = main_table.customer_id AND cust_fname.attribute_id = 1
LEFT JOIN `customer_entity_varchar` AS `cust_mname` ON cust_mname.entity_id = main_table.customer_id AND cust_mname.attribute_id = 827
LEFT JOIN `customer_entity_varchar` AS `cust_lname` ON cust_lname.entity_id = main_table.customer_id AND cust_lname.attribute_id = 2
WHERE (`items_count` != '0') AND (`main_table`.`is_active` = '1')

I would like to have in column email:

COALESCE(cust_email.email, main_table.customer_email)


texts: Uploading images while uploading product programmatically on frontend

texts:
In my project, customer can upload their products from the user dashboard ( not from super admin dashboard). I have made a product upload form where customer can upload their product or items. I am able to save all the product information through custom form. However, I am unable to upload the product images. I have gone through this post

https://stackoverflow.com/questions/8456954/magento-programmatically-add-product-image unable to uploade it

I have tired the code as after saving product information thru form :

$filename = $_FILES['image']['name'];

        $mediaArray = array(
            'thumbnail'   => $filename,
            'small_image' => $filename,
            'image'       => $filename,
        );

        // Remove unset images, add image to gallery if exists
        $importDir = Mage::getBaseDir('media') . DS . 'import'.DS;

        foreach($mediaArray as $imageType => $fileName) {
        echo    $filePath = $importDir.$fileName;

    $productData->addImageToMediaGallery($filePath, $imageType, false, false);

          }
     }

It shows the error as :

  There has been an error processing your request. Image does not exist.


texts: How to override protected method in magento2?

texts:
I want to override protected method by rewrite class in magento2.
I want to overrride and change code when you save attribute multi select option from backend here is my code.

<?php
 namespace Testmodule\Testattribute\Model\ResourceModel\Entity;
 class Attribute extends \Magento\Eav\Model\ResourceModel\Entity\Attribute
 {
    protected function _updateAttributeOption($object, $optionId, $option)
    {
        //custom code
    }
 }

Second method I want to rewrite for set attribute option value when you edit multi select attribute.

<?php
 namespace Testmodule\Testattribute\Block\Adminhtml\Attribute\Edit\Options;
 class Options extends \Magento\Eav\Block\Adminhtml\Attribute\Edit\Options\Options
 {
      protected $_template = 'Testmodule_TestAttribute::catalog/product/attribute/options.phtml';

      protected function _prepareUserDefinedAttributeOptionValues($option, $inputType, $defaultValues)
      {
            //custom code
      }
 }

This is my di.xml

<?xml version="1.0"?>
 <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd">
    <preference for="Magento\Eav\Block\Adminhtml\Attribute\Edit\Options\Options" type="Drc\Attributeimage\Block\Adminhtml\Attribute\Edit\Options\Options" />
    <preference for="Magento\Eav\Model\ResourceModel\Entity\Attribute" type="Testmodule\Testattribute\Model\ResourceModel\Entity\Attribute" />
    <preference for="Magento\Catalog\Block\Adminhtml\Product\Attribute\Edit\Form" type="Testmodule\Testattribute\Block\Adminhtml\Product\Attribute\Edit\Form" />
</config>

This is form file I want to change form enctype property

 <?php
  namespace Testmodule\Testattribute\Block\Adminhtml\Product\Attribute\Edit;

  class Form extends \Magento\Catalog\Block\Adminhtml\Product\Attribute\Edit\Form
  {
     protected function _prepareForm()
     {
        $form = $this->_formFactory->create(
        ['data' => ['id' => 'edit_form', 'action' => $this->getData('action'),'enctype'=>'multipart/form-data', 'method' => 'post']]
    );
       $form->setUseContainer(true);
       $this->setForm($form);
       return parent::_prepareForm();
     }
  }

Please Help me for override this protected methods in magento2.


texts: Can't deploy Magento2 theme locally on MAMP

texts:
I am supposed to rework a front end design of an existing Magento2 website, I already have a local installation of Magento2 on MAMP with composer. I used my project's git repo so all the files in app/design are there.

I am coming from Wordpress so I read up the documentation and I understand I have to use php bin/magento setup:static-content:deploy to make the theme visible but while that command works on the development server it doesn't work on the local MAMP, same as any other bin/magento command (like cache:clean or setup:install etc - after a while I started trying randomly).

I was searching for this on stack forums and several people suggested to manually remove var/di, var/cache, var/page_cache and var/generation, which I did, and now the frontend and Magento backend are both down. The bin/magento commands still don't work.

How can I deploy Magento2 theme on localhost on a MAMP server?

The error:

[InvalidArgumentException]
There are no commands defined in the "setup:static-content" namespace.
Did you mean one of these?
  setup
  setup:config
  setup:cron
  setup:db-data
  setup:db-schema
  setup:db
  setup:di
  setup:performance
  setup:store-config

when I run one of the suggestions I get analogous error:

[InvalidArgumentException]
 Command "setup:store-config" is not defined.
 Did you mean one of these?
  setup:store-config:set
  setup:backup
  setup:config:set
  setup:cron:run
  setup:db-data:upgrade
  setup:db-schema:upgrade
  setup:db:status
  setup:di:compile
  setup:performance:generate-fixtures
  setup:install
  setup:rollback
  setup:upgrade
  setup:uninstall


texts: Dynamically duplicate category, i.e. take products from other category. Extension?

texts:
recently we decided to set-up some landingpages for specific keywords. I must say I am not a huge fan of it .. but hey let's give it a try.

Normally I would set-up a CMS Page and write some text maybe add products. But thinking about it I would really like to use (dummy) catgeory pages for it: they have a banner, text block, products etc. ..... and they don't break during upgrades. I set them to anchor = no and include in navigation = no.

Situation: So the only thing I miss and would like to ask: is that I do not want to manually add products to this new category. What I would want to do is to select an already existing category and have this category show the member products of the existing category (dynamically, meaning that if I add products to the existing category they are also added to the new landingpage category).

Similar extensions: I had a look at these extensions that seem to do something similar, but not quite what we are hoping for: https://github.com/tzyganu/rule-products  and http://amasty.com/landing-pages.html

Question: how can I create new categories that differ only in the way I select the products. Instead of selecting the products individually, I select an other category (ID) to take the products collection (only) from ....

many thanks, Sean


texts: Magento 2.1.1 Check Component Dependency

texts:
I am getting Check Component Dependency which is showing many issues. See below.
But.. my PHP version on the webhosting is 7.0 and in the Magento Setup Pgae showing  5.6.19. how it comes?
Please advise.
Thank you


texts: I want to show size attributs in product page dynamically same as below screnshot how can i do that

texts: I want to show sizes attribute like shown in the image in my custom theme.


texts: How to create the new payment module for redirect into payment gateway website in Magento 2

texts:
I have referred so many blogs, I didn't get the correct way to implement the payment gateway with redirection into payment site

Also confused whether the order entry is created in the database Before going the payment site? or After complete the payment process?

While click on the "place order" button, will do the following.

Create the new order entry in the database.
Get the order related information's like order id, amount, currency, First name, last name.. etc
Create the gateway URL, using the external library from the given information(API key, username) and order related information(amount, order id, billing address, success URL, Failed URL,.. etc)
Redirect to the gateway URL.
Once the payment is completed, the external payment site will provide the payment information into given Web-hook URL.
The web-hook URL get payment information and update the order status by order id.
Redirect into success/failure page based on the payment status.

How to proceed into the correct way and make it works perfectly.

Can you explain with code examples?


texts: Where to find a solid Magento 2 SOAP-API Documentation

texts:
I'm currently working on a webapp that communicates with a magento 2 server. I tried to use the soap interface for the communication but it quickly turned out, that the soap api changed from Magento 1 to 2.
One difference i stumbled across, is that when i create a new category for example, i have to add the attribute isActive to the request. In the past, i used is_active but by using it, i always got an error, saying "is_active" is missing. After changing is_active to isActive it worked.
My problems with this are:

I found out about the change by pure luck
The error message from magento was absolutely misleading

In the magento 2 devdocs i only found a solid documentation for the rest-api with all possible requests and what to send in the request body. I guess the soap api uses similar request bodies, but now i can't be sure anymore and don't want to get lost while programming due to lack of documentation.

So does anybody know where i can find a truly solid soap api overview for magento 2? All i can find is: How to get an auth-token and an list of the services and functions, but no documentation of the needed request body etc.


texts:
I'm trying to find a way of stopping users in the back end of the site from adding certain product types.

I don't need to remove all the functionality of the product types I just need to remove the virtual and downloadable options from the new product page.

I've tried to find where this is in the back end with a lot of code digging but I'm not very up to date with the admin section of Magento as I am with building things for the front end.


texts: Lock order details page in backend when being viewed by another user

texts: Is it possible to restrict access to orders detail page when it is viewed by another user?


texts: Category links in menu don't work when switching language

texts:
So basically I added a new view store (for language purposes), and when selecting a single product from the home page, it redirect correctly to that product, but if I use my mega menu to for example click on "Men's Watches", it gives me an error like this

  SQLSTATE[42S02]: Base table or view not found: 1146 Table 'magento.catalogsearch_fulltext_scope3' doesn't exist, query was...

Any idea ?


texts:
I am new to magento, I have a custom module for product advertising by registered user. When user check the phone check-box for adding phone number to Default Billing address (if not added the phone number already), it's return an error.

Fatal error: Call to a member function save() on a non-object

My code is,

if (isset($_POST['request_flag'])):
$customer = Mage::getSingleton('customer/session')->getCustomer();
$email = $customer->getEmail();
$firstName = $customer->getFirstname();
$lastName = $customer->getLastname();
$fullName = $firstName . " " . $lastName;
$sellerId = $customer->getentity_id();

$params = $this->getRequest()->getParams();
$newProduct = new Mage_Catalog_Model_Product();

if (isset($_POST['phone_check'])) { //save phone no to customer's address
    $customerAddressId = $customer->getDefaultBilling();
    if ($customerAddressId) {
        $customAddress = Mage::getModel('customer/address')->load($customerAddressId);
        $customAddress->setTelephone($params['phone']);
    }
    try {
        $customAddress->save(); //**Error occurred here.**
    } catch (Exception $ex) {
        Zend_Debug::dump($ex->getMessage());
    }
}

Please, any one tell me where I went wrong? or suggest me to what to do.

Thanks.


texts:
I have looked and tried for days, so I am going to try asking here.
I need to scan a barcode and through that, get a product from the magento store.
I have been trying to use these to get some results but no luck.

$collection = Mage::getModel('module/model_name')->getCollection()
$collection = Mage::getModel('catalog/category')->load($categoryId)

I can get Id through the SKU, but that's about it. Can anyone help me with this issue? I would appreciate your help very much.

If this is not possible, would it be possible to make a custom attribute like the sku? (Super attribute or what they are called). So I would be able to get it like the sku?

This is what I ended up doing:

  $scannerData = $_REQUEST["q"];  //The scanned data

  $catId = 2; //Categori id - 2 is root

  $categories = new Mage_Catalog_Model_Category();

  $categories->load($catId);

  $collection = $categories->getProductCollection()->addAttributeToSelect('ean')
  ->addAttributeToFilter('ean', $scannerData);

  foreach ($collection as $product){

  $product_id = $product->getId();
  $_product = Mage::getModel('catalog/product')->load($product_id);
  }

//Do whatever with the product here


texts: How to set default shipping method in case of multiple shipping methods in magento 2?

texts: There are 2 Shipping methods and by default no one is selected, user have to manually select one, as a result it say shipping (undefined-undefined). I want that First item should be automatically comes selected if none is selected how this can be done in magento 2


texts: change custom page to editable CMS, page shows blank

texts:
After deleting both the template and layout pages of a custom page in our store I recreated the page in the admin CMS panel.  When I entered the URL I am brought to a page that is now blank.  What is causing this?  How do I push my CMS pages to functionaly?

thx.


texts:
I have created a module to save order details to a custom mysql table after checkout completion. All works fine but the order id saves in the format "210"(order_id) instead of "1000000210"(increment_id). How can I get this format?
My observer looks like this:

public function execute(Observer $observer)
    {

        $orderId = $observer->getEvent()->getOrderIds()[0];
        $order = $this->orderRepository->get($orderId);
        $this->postSaverModel->create()->doSync($orderId);

    }


texts: Redirect to same product URL after error from Add To Cart

texts:
Overview:

On my product called Test Product has 10 quantity.

So when I put 40 quantity and press add to cart. (Remember, the quantity of the product is 10, so it should prompt an error)

The output is correct, the user got notified by the system that they put greater than the quantity than the actual quantity of the product.

If you look at the URL closely, before the user click the add to cart, the URL is

When the error has been shown, the URL is

Meaning, magento removes the category link and redirects to the actual product link.

Question
Is there any way for magento to redirect to the current category instead of the product link?