texts: Magento 2 - Enabling Flat Catalog causes SQL error. Reading from "report" tables

texts:
When I enable the flat catalog in my Magento 2.2.5 installation, I get an error.

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'e.name' in 'field list', query was: SELECT COUNT(report_table_views.event_id) AS `views`, `e`.*, `price_index`.`price`, `price_index`.`tax_class_id`, `price_index`.`final_price`, IF(price_index.tier_price IS NOT NULL, LEAST(price_index.min_price, price_index.tier_price), price_index.min_price) AS `minimal_price`, `price_index`.`min_price`, `price_index`.`max_price`, `price_index`.`tier_price`, `e`.`name`, `e`.`short_description`, `e`.`price`, `e`.`special_price`, `e`.`special_from_date`, `e`.`special_to_date`, `e`.`weight`, `e`.`image`, `e`.`small_image`, `e`.`thumbnail`, `e`.`color`, `e`.`color_value`, `e`.`news_from_date`, `e`.`news_to_date`, `e`.`required_options`, `e`.`image_label`, `e`.`small_image_label`, `e`.`thumbnail_label`, `e`.`price_type`, `e`.`weight_type`, `e`.`price_view`, `e`.`msrp`, `e`.`msrp_display_actual_price_type`, `e`.`url_key`, `e`.`links_purchased_separately`, `e`.`links_exist`, `e`.`tax_class_id`, `e`.`swatch_image`, `e`.`list_price`, `e`.`supplier_code`, `e`.`apparel_size`, `e`.`apparel_size_value`, `e`.`apparel_occasion`, `e`.`apparel_occasion_value`, `e`.`apparel_style`, `e`.`apparel_style_value`, `e`.`apparel_gender`, `e`.`apparel_gender_value`, `e`.`material`, `e`.`material_value`, `e`.`exh_size`, `e`.`exh_size_value`, `e`.`exh_adapter`, `e`.`exh_adapter_value`, `e`.`karmak_pn`, `e`.`freight_free`, `e`.`free_shipping`, `e`.`backorder_shipping_message`, `e`.`brands`, `e`.`brands_value`, `cat_index`.`position` AS `cat_index_position`, `stock_status_index`.`stock_status` AS `is_salable` FROM `report_event` AS `report_table_views`
 INNER JOIN `catalog_product_entity` AS `e` ON e.entity_id = report_table_views.object_id
 INNER JOIN `catalog_product_index_price` AS `price_index` ON price_index.entity_id = e.entity_id AND price_index.website_id = '1' AND price_index.customer_group_id = 0
 INNER JOIN `catalog_category_product_index_store1` AS `cat_index` ON cat_index.product_id=e.entity_id AND cat_index.store_id='1' AND cat_index.visibility IN(2, 4) AND cat_index.category_id='2'
 LEFT JOIN `cataloginventory_stock_status` AS `stock_status_index` ON e.entity_id = stock_status_index.product_id AND stock_status_index.website_id = 0 AND stock_status_index.stock_id = 1 WHERE (report_table_views.event_type_id = 1) AND (logged_at >= '2018-08-13') AND (logged_at <= '2019-01-20') GROUP BY `e`.`entity_id` HAVING (COUNT(report_table_views.event_id) > 0) ORDER BY `views` DESC
 LIMIT 12

It looks like Magento is trying to read from report_event table and other "report" tables which seems odd for catalog data.

Any ideas on why this error is happening? Do I need certain settings turned on for each attribute? Any help is appreciated, thank you!

Edit: I have tried php/bin magento indexer:reindex with no luck. I have also tried removing all extensions from the app/code/ directory and running the setup:upgrade, setup:di:compile, indexer:reindex, & cache:flush. No luck so far.


texts: Magento 2: How is it possible to call a static block in category description?

texts:
is it possible to call static blocks in the category description of magento 2?

I don´t want to use the "Add CMS Block" DropDown under the description field.

It is necessary to call the blocks in the description field.

I would like to call blocks like sliders: {{revslider alias="fullslider-en"}}

or product lists:

{{block class="Infortis\Base\Block\Product\ProductList\Featured" template="product/list.phtml" category_id="13"}}

Any ideas?

Many thanks in advance
Andi


texts: Magento: Category Name vs Page Title Name

texts:
How can a page title name (not meta) be different from the Category "Name"?

For example:

Main Category 1: ABC

Sub-Category (under ABC): DEF

On the navigation menu, the main category is displayed as "ABC" and the sub-category as DEF. However, when I user clicks on the DEF sub-category, how can the page title (on the page) be something other than the (default) DEF name? For example, DEF Stuff.

In other words, how can we have a page title (on the page; not meta) that is different from the category Name (field)?


texts:
In my product page, static block is set properly but its now showing up images attached to it. link - http://kiabzanew.site/index.php/new-arrivals/pink-republic-top.html

pls check SS


texts: Argument passed to __construct() must be an instance of \Helper\Data

texts:
I get this error
Argument 2 passed to [VENDOR][MODULE]\Controller\Index\Index::__construct() must be an instance of [VENDOR][MODULE]\Helper\Data

this is my controller

namespace [VENDOR]\[MODULE]\Controller\Index;

use \Magento\Framework\App\Action\Action;
use \Magento\Framework\View\Result\PageFactory;
use \Magento\Framework\View\Result\Page;
use \Magento\Framework\App\Action\Context;
use \Magento\Framework\Exception\LocalizedException;
use \[VENDOR]\[MODULE]\Helper\Data;

class Index extends Action
{
    /**
     * @var PageFactory
     */
    protected $resultPageFactory;
    protected $helperData;

    /**
     * @param Context $context
     * @param PageFactory $resultPageFactory
     *
     * @codeCoverageIgnore
     * @SuppressWarnings(PHPMD.ExcessiveParameterList)
     */
    public function __construct(
        Context $context,
        Data $helperData,
        PageFactory $resultPageFactory

    ) {
        parent::__construct(
            $context
        );
        $this->resultPageFactory = $resultPageFactory;
        $this->helperData = $helperData;
    }

    /**
     * Prints the blog from informed order id
     * @return Page
     * @throws LocalizedException
     */
    public function execute()
    {
        echo $this->helperData->getGeneralConfig('enable');
        echo $this->helperData->getGeneralConfig('display_text');
        exit();
        // $resultPage = $this->resultPageFactory->create();
        // return $resultPage;
    }
}

this is my helper

namespace [VENDOR]\[MODULE]\Helper;

use Magento\Framework\App\Helper\AbstractHelper;
use Magento\Store\Model\ScopeInterface;

class Data extends AbstractHelper
{

    const XML_PATH_BLOG = 'blog/';

    public function getConfigValue($field, $storeId = null)
    {
        return $this->scopeConfig->getValue(
            $field, ScopeInterface::SCOPE_STORE, $storeId
        );
    }

    public function getGeneralConfig($code, $storeId = null)
    {

        return $this->getConfigValue(self::XML_PATH_BLOG .'general/'. $code, $storeId);
    }

}


texts: Magento 2 : How to Apply Custom Discount from Controller?

texts:
How can i apply Custom Discount to cart using my custom controller ??

I've read many answers on web but all are same, All uses Model,CustomDiscount.php file to apply discount.

I would like to apply it from my custom controller OR Programmatically ?

Any help would be really APPRECIATE.


texts: How to add google maps to contact us page magento2

texts: I am new in magento. I want to add google maps into COntact Us page in magento . I am not getting how to do? Anyone help.


texts: Get all products with status = enabled and price (not working)

texts:
I've been trying without success to obtain all products with status = enabled from MAGENTO database and the price.

  My query shows ALL the items (enabled and disabled ones) and i want to
  get only those with status = enabled.

This is my query:

SELECT main.sku, option_value_brand.value AS code_brand, code_business_unit.value as code_business_unit
FROM catalog_product_entity AS main
LEFT JOIN eav_attribute attribute_brand on attribute_brand.attribute_code = 'code_brand' and attribute_brand.entity_type_id = 4
LEFT JOIN eav_attribute attribute_business_unit on attribute_business_unit.attribute_code = 'code_business_unit' and attribute_brand.entity_type_id = 4
LEFT JOIN catalog_product_entity_int code_brand ON main.entity_id = code_brand.entity_id and code_brand.attribute_id = attribute_brand.attribute_id
LEFT JOIN eav_attribute_option option_brand on option_brand.attribute_id = code_brand.attribute_id and option_brand.option_id = code_brand.value
LEFT JOIN eav_attribute_option_value option_value_brand on option_brand.option_id = option_value_brand.option_id
LEFT JOIN catalog_product_entity_varchar code_business_unit ON main.entity_id = code_business_unit.entity_id and code_business_unit.attribute_id = attribute_business_unit.attribute_id;

How should i modify my query in order to obtain what i want (all the items with status = enabled AND the price?)

I tried to use this condition but it did not work:

WHERE catalog_product_entity_int.value = 1


texts: Magento 2: Upgrade Readiness Check Cron script readiness check failed

texts:
I have installed Magento 2 CE Version 2.1.0. I'm doing System Upgrade on my Linux Server

It gives below error

[UPDATE]

Instead of GUI i'm using CLI.

How to update Magento2 using composer

I'm using @Mukesh Chapagain Solution

Updating/Upgrading to Magento 2.X.X (via composer) Latest is 2.1.1

composer require magento/product-community-edition 2.X.X --no-update
composer update //If your receive out of memory error then in apache php.ini please update your memory_limit 7680000M Example
rm -rf var/di var/generation
php bin/magento cache:flush
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento indexer:reindex

After upgrade, check your Magento version with the following command:

php bin/magento --version

Worked for me :) Why it doesn't work with GUI?


texts: Fatal error: Out of memory (in composer) during upgrade Magento2.2.1 to Magento 2.3 when run composer update command

texts:
Fatal error: Out of memory (allocated 1045438464) (tried to allocate
  16777216 bytes) in
  phar:///usr/local/bin/composer.phar/src/Composer/DependencyResolver/Solver.php
  on line 220

I am using Siteground Hosting.


texts: Get all coupons applicable for a logged in customer

texts:
Is there someway to find all the coupon codes which is applicable for the logged in customer?

One way is to collect all the coupon codes, loop over them and apply to quote object in order to check it's validity.
Something similar to following code:

$eligibleCoupons = array();
$allAvailableCoupons = array('xxx', 'yyy', 'zzz', /* ... */);
foreach ($allAvailableCoupons as $couponCode) {
    $codeLength = strlen($couponCode);
    $isCodeLengthValid = $codeLength && $codeLength <= Mage_Checkout_Helper_Cart::COUPON_CODE_MAX_LENGTH;

    $this->_getQuote()->getShippingAddress()->setCollectShippingRates(true);
    $this->_getQuote()->setCouponCode($isCodeLengthValid ? $couponCode : '')
        ->collectTotals()
        ->save();

    if ($codeLength) {
        if ($isCodeLengthValid && $couponCode == $this->_getQuote()->getCouponCode()) {
            $eligibleCoupons[] = $couponCode
            //finally remove coupon code apply
            $this->_getQuote()->setCouponCode('')
                            ->collectTotals()
                            ->save();
        } else {

        }
    }
}
var_dump($eligibleCoupons);

But this method seems lengthy and resource consuming.

I bet there must be an easier approach for this.


texts:
For up and crosssell i want to add a parameter to getPriceHtml.

this is the current call :

<?php echo $this->getPriceHtml($_item, true, '-related') ?>

i want to add a new parameter TRUE(default) or FALSE so i can hide certain elements in catalog/product/price.html. So my call becomes :

<?php echo $this->getPriceHtml($_item, true, '-related', false) ?>

Where ( or better : HOW ? ) do I define this new parameter ?


texts: Magento 2.1.8 issue Undefined variable: imageBlockBuilder

texts:
I got following error in Magento 2.1.8 in my custom theme e.g. mytheme.

  Exception #0 (Exception): Notice: Undefined variable:
  imageBlockBuilder in
  /home/public_html/app/design/frontend/Company/mytheme/Magento_Catalog/templates/product/list/items.phtml
  on line 220


texts: I have try to import values of attributes, in my excel contains 60 of records, but only 43 records imported, what about my remaining values.


texts: Success URL for Payflow Link Pro in Magento 2.1

texts:
I have configured PayPal flow Link Pro, It's working fine but success page is not coming. I found for success page we need to configure success URL in payment side. Is that below success URL is correct or not? If any other success URL we need to set means please tell...Thanks in advance...

Base_URL/checkout/onepage/success/


texts:
I got a problem with my Magento shop. Today I have analysed my shop on 404-bad URL links with a online tool (brokenlinkcheck.com). I was shocked when I saw the results.

The problem: Every category shows up with the base-URL on the end.

So, for my knoledge I know this is wrong. I have done some research but I did not find any usefull information to take action. I hope there is a solution. How can we solve this?


texts: Fetching Quote Items of Inactive Cart (Abandoned cart)

texts:
I am trying to fetch all the items of a Quote.

First i am load the quote using \Magento\Quote\Api\CartRepositoryInterface

with get() method i am getting Magento\Quote\Api\Data\CartInterface

using getItems() method of CartInterface i am getting null even when items are in a quote.

If i change the quote status to Active inside quote table then it is showing.

How i can fetch quote item even if it is inactive?


texts: Magento 2 : How to get DefaultBillingAddress using knockout?

texts:
In core using KO address is get like this in details.html file

,

This is currentbillingaddress but i want to get defaultbillingaddress in the same way this is, someone any idea


texts: Execution time: 94.293220043182 in magento2

texts:
I have install fresh magento2.2.2 version in my local system
When I am going to run php bin/magento setup:static-content:deploy -f
command it's give me Execution time error...
i have attached screen shot regarding error


texts: How to add computation on a product attribute in magento admin

texts:
Anyone can help me achieve my query? I'm no expert in magento but I know php conditions but I don't know how to apply my need in magento. I'm thinking of using attributes because I believe there is no other solution. So here it goes:

In magento admin product page, I want to add manually cost price attribute, shipping cost attribute, and total cost attribute, but Total Cost automated, it should have a computation wherein it will add cost price and shipping cost. Then lastly, auto computation for the Profit attribute, where it will calculate, Selling price (Default Product price attribute) minus Total Cost divide by Selling price.

Looking forward to hear from all the magento ninja. Thank you!

So far this is what I've done based on the Module Tutorial Link given by @Sander. And followed the code of @Andarsh

in config.xml

    <modules>
    <ProfitAndTotalCost_ProfitAndTotalComputation>
        <version>0.0.1</version>
    </ProfitAndTotalCost_ProfitAndTotalComputation>
</modules>

<global>
    <models>
        <ProfitAndTotalCost_ProfitAndTotalComputation>
            <class>ProfitAndTotalCost_ProfitAndTotalComputation_Model</class>
        </ProfitAndTotalCost_ProfitAndTotalComputation>
    </models>

    <events>
        <catalog_product_save_before>
            <observers>
                <profitandtotalcost_profitandtotalcomputation>
                    <type>singleton</type>
                    <class>profitandtotalcost_profitandtotalcomputation/observer</class>
                    <method>addCostAndShipping</method>
                </profitandtotalcost_profitandtotalcomputation>
            </observers>
        </catalog_product_save_before>
    </events>
</global>

For the Observer.php

class ProfitAndTotalCost_ProfitAndTotalComputation_Model_Observer
{
    public function addCostAndShipping($observer)
    {
       $product = $observer->getProduct();
       $cost_price = $product->getAttributeText('cost');
       $shipping_cost = $product->getAttributeText('supp_main_landed_cost');

       $total_cost = $cost_price + $shipping_cost;

       //save to total cost
       $product->setTotalCostMain($total_cost)->save();
       Mage::log($product->getId() . " - ".$product->getTotalCostMain(), null, 'custom_log.log'); //create a file in /var/log folder
    }
}

This is my module: ProfitAndTotalCost_ProfitAndTotalComputation.xml

<?xml version="1.0" encoding="UTF-8"?>
<config>
    <modules>
        <ProfitAndTotalCost_ProfitAndTotalComputation>
            <active>true</active>
            <codePool>local</codePool>
        </ProfitAndTotalCost_ProfitAndTotalComputation>
    </modules>
</config>


texts: How to override product attribute Save.php controller using modulein magento 2?

texts:
I am trying to create a module in which I am facing some issues to override Save.php Controller as well as save that data in the new table.

here is my updated di.xml code, but now after click on save, the redirect URL is blank.

<?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\Catalog\Controller\Adminhtml\Product\Attribute\Save" type="Lucent\LiTab\Controller\Adminhtml\Product\Attribute\Save" />
</config>

and my controller code for override is

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

namespace Lucent\LiTab\Controller\Adminhtml\Product\Attribute;

class Save extends \Magento\Catalog\Controller\Adminhtml\Product\Attribute\Save
{
    public function execute()
    {
        $data = $this->getRequest()->getPostValue();
        print_r($data);
        die();
    }
}

So please let me know where I did wrong code.

Please give me a solution for this!


texts:
I have created an array which contains 2 images, I want to show these images randomly (so one shows then when the page is refreshed a different show, etc) I have re-used code i used a long time ago and it doesn't seem to be working could someone help me with where i am going wrong please.

<?php
$images = array(
            '',
            ''
        );

shuffle($images); // Randomize images array;
?>

I dont understand where it is going wrong but on the front end it show an image with the broken link sign in it,

Thank you in advance


texts: Magento 2 Bug in validator.js file of module-payment?

texts:
Found bug in validator.js file

Magento 2.1.1 path:/vendor/magento/module-payment/view/frontend/web/js/model/credit-card-validation/validator.js

Magento 2.1.3 path:/vendor/magento/module-payment/view/base/web/js/model/credit-card-validation/validator.js

There is a validation in Credit Card Expiry for Month And Year
But Magento providing same validation for Month and Year.

For month: code starts from line no 61

'validate-card-date': [

        /**
         * Validate credit card number based on mod 10
         * @param {String} date - month
         * @return {Boolean}
         */
        function (date) {
            return monthValidator(date).isValid;
        },
        $.mage.__('Incorrect credit card expiration month.')
    ],

For year: code starts from line no 87

'validate-card-year': [

        /**
         * Validate credit card number based on mod 10
         * @param {String} date - month
         * @return {Boolean}
         */
        function (date) {
            return monthValidator(date).isValid;
        },
        $.mage.__('Incorrect credit card expiration year.')
    ]

There is need to replace 1 line of code : line no 95

function (date) {
            return expirationDateValidator(date).isValid;
        },

instead of :

function (date) {
            return monthValidator(date).isValid;
        },

How should I fix it?

Can anyone help me?


texts:
I am using Magento 1.7. If a coupon code is used I am trying to include it in the PDF invoice. I have been trying the suggestions in this thread http://www.magentocommerce.com/boards/viewthread/56110/ changing app/code/core/Mage/Sales/Model/Order/Pdf/Invoice.php however any changes I make to this file do not appear to do anything to the generated PDF. I also tried overriding it in app/code/local/Mage/Sales/Model/Order/Pdf/Invoice.php and making any changes to this file did not make any difference.

Any suggestions much appreciated, I have spent a long time trying to find answers.

edit

Added this

 /* print coupon code on invoice */
 if($order->getCouponCode()!=""){
    $this->y -= 12;
    $page->drawText('Code: '.$order->getCouponCode(), 450, $this->y, 'UTF-8');
 }

  /* print gift certificate code on invoice */
  if($order->getGiftcertCode()!=""){
     $this->y -= 12;
     $page->drawText('Code: '.$order->getGiftcertCode(), 450, $this->y, 'UTF-8');
  }

In app/code/local/Mage/Sales/Model/Order/Pdf/Invoice.pdf  before $this->insertTotals($page, $invoice) on line 149.


texts: Magento 2: add product (catalog) to cart when button is clicked

texts:
In a custom widget that displays on main page and category pages, I need to have a button clicking on which should add product catalog (having it's own sku) to the cart. Can you please suggest how to go about this?

Path of the custom widget is

app/code/<vendorname>/<modulename>/view/frontend/templates/widget/<widgetname.phtml>


texts:
I am getting below error to enabling maintenance mode by adding a file var/.maintenance.flag

  Unable to proceed: the maintenance mode is enabled.  0
  /vendor/magento/framework/App/Bootstrap.php(256):
  Magento\Framework\App\Bootstrap->assertMaintenance() 1 /index.php(49):
  Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http))
  2 {main}

Please help me to fix this issue.


texts: How Can I insert multiple image in WYSIWYG Editor in Magento1.9.x?

texts: Magento1.9.x version in need multiple image upload at a time in WYSIWYG Editor.


texts: How To Add Country And State Dropdown In Admin Side in Magento2

texts: I need to add country and state drop down in admin form how to do it


texts: Menu that open by itself after clicking on the link of a parent category

texts:
When I click on parent category, the page load but the menu re-open if the pointer of the mouse is still present.

What do you recommend so that the menu does not re-open immediately ?

I found PHP of display :

    public function getMegamenu($catTop, $blocks)
{
    // Draw Mega Menu
    $idTop    = $catTop->getEntityId();
    $hasChild = $catTop->hasChildren();
    $desktopTmp = $mobileTmp  = '';
    if($hasChild || $blocks['top'] || $blocks['left'] || $blocks['right'] || $blocks['bottom']) :
        $desktopTmp .= '
';  /* Wrap Mega */
            $desktopTmp .='
';  /*  Content Mega */
                $desktopTmp .= $blocks['top'];
                $desktopTmp .= '
';
                    $desktopTmp .= $blocks['left'];
                    if($hasChild) :
                        $desktopTmp .= '
';
                        $mobileTmp .= '
';
                        $childTop  =  $this->getChildExt($idTop);
                        foreach ($childTop as $child) {
                            $class = $this->isCategoryActive($child->getId()) ? ' level1 active' : ' level1';
                            $url =  'getUrl().'">'.__($child->getName()) . $this->getCatLabel($child) . '';
                            $childHtml = ($this->_recursionLevel != 2 ) ? $this->getTreeCategoriesExt($child->getId()) : ''; // include magic_label
                            // $childHtml = ($this->_recursionLevel != 2 ) ? $this->getTreeCategoriesExtra($child->getId()) : ''; // include magic_label and Maximal Depth
                            $desktopTmp .= '
' . $this->getImage($child) . $url . $childHtml . '
';
                            $mobileTmp  .= '
' . $url . $childHtml . '
';
                        }
                        //$desktopTmp .= '
'  .$blocks['bottom']. '
';
                        $desktopTmp .= '
'; // end cat-mega
                        $mobileTmp .= '
';
                    endif;
                    $desktopTmp .= $blocks['right'];
                $desktopTmp .= '
';
                $desktopTmp .= $blocks['bottom'];
            $desktopTmp .= '
';  /* End Content mega */
        $desktopTmp .= '
';  /* Warp Mega */
    endif;
    return array('desktop' => $desktopTmp, 'mobile' => $mobileTmp);
}

CSS :

...

.magicmenu .nav-desktop .level0 .level-top-mega,
.magicmenu .nav-desktop .level0.dropdown > .level0{  border-style: solid ;border-width: 1px;padding: 0px 23px;position:absolute;z-index:99999;display:block;opacity:0;top:130%;visibility:hidden;transition:all 300ms ease-in-out 0s;-moz-transition:all 300ms ease-in-out 0s;-webkit-transition:all 300ms ease-in-out 0s;-o-transition:all 300ms ease-in-out 0s;box-shadow: 0 0 7px rgba(0, 0, 0, 0.3);}
.magicmenu .nav-desktop .level0:hover .level-top-mega,
.magicmenu .nav-desktop .level0.dropdown:hover > .level0{opacity:1;top: 39px;visibility:visible;}

...


texts: Firefox adding trailing slash and the URL breaks

texts:
I got a custom menu plugin in Magento2 as below.

class TopmenuPlugin {

    public function afterGetHtml(\Magento\Theme\Block\Html\Topmenu $topmenu, $html) {

    $html = '';
    $html .= "
";
    $html .= "" . __("Home") . "";
    $html .= "
";
    ....

In Chrome and IE the URL is

http://website.com/index.php

In Firefox the URL is

http://website.com\/index.php

And in Firefox I am getting Whoops, our bad... error

Is there something I am missing here????


texts: Magento 2 Product page seprate Custom Option, swatch color and Add to cart product page

texts:
I have a requirement of customization of product layout page.

I created custom options on configurable product page which have also swatch color option.Now I want to move these blocks on bottom section on page layout.
I want to swatch images and custom options of product page with one place while add to cart button on another place.

We are move element and able to separate these blocks but I am not able to add to cart button clickable because of product-add-form.

As per Magento2 Standard product page swatch,custom option and add to cart should one place in  product-add-form .

Please suggest how can we separate these blocks?


texts:
I have Debian 8 with PHP 5.6 installed on my server. I recently installed Magento 2.0.2 and also successfully installed varnish-4.0.2 to use it as a cache on my web server.

I tried to configure varnish-4.0.2 with magento 2 but unfortunately, I'm getting failed every time. The reason why I am saying this because varnish is giving no such performance as compared to I previously experienced with Magento 1.9.2.3. Can anyone please guide me with proper configuration and installation of varnish with magento 2?


texts: after login in - customer is taken back to the shopping cart (where the product they selected is) INSTEAD of the 1st step of the checkout

texts:
Please help - I can't figure this out and customers are not able to place orders...The interesting thing is that everything works the way it suppose to in Firefox but NOT in Chrome...

What happens is this:

Customer selects a product and goes through the steps up till the login page.
At the login page - they put in their login credentials (user Id and password) and click on LOGIN
This is where it happens in Chrome (it works fine in Firefox) - instead of the shopping cart showing the 1st step of the CHECKOUT -  1
Billing Information (Select a billing address from your address book or enter a new address.) - the customer is taken back to the SHOPPING CART where it shows the product they selected...
Now they have to click on the "Proceed to Checkout" button but nothing happens after the first click! (it just refreshes the same page). Then - they have to click that button again and are taken to a page which displays this:

  SHOPPING CART IS EMPTY

You have no items in your shopping cart.

Click here to continue shopping.

Please help me - I am clueless! I haven't changed anything other than upgrading the Cloud hosting package to a better one (with more resources).


texts:
So I've had no issues with writing simple queries and pulling the data through that I need (mostly using fetchOne(), but this is my first time trying it with a little bit more comprehensive query.

I'm having trouble displaying any of the data that I want, period. This is what I have right now.

<?php
$resource = Mage::getSingleton('core/resource');

$readConnection = $resource->getConnection('core_read');

$userTable = $resource->getTableName('ced_csmarketplace_vendor_varchar');
$salesTable = $resource->getTableName('ced_csmarketplace_vendor_sales_order');
$query = mysql_query("SELECT $userTable.value,
SUM(DISTINCT(base_order_total))
FROM $salesTable
INNER JOIN $userTable ON $salesTable.vendor_id=$userTable.entity_id
WHERE payment_state='2'
GROUP BY vendor_id
ORDER BY SUM(base_order_total) DESC
LIMIT 5");
?>

What I'm trying to do is fetch the top 5 vendor usernames (value), ordered by their total sales amounts. In order to do so, I have to pull from two different tables. I assume I'll have to use a while loop, but am still a little new to fetching data from two different tables in PHP. I know the query works, as I've tested it, it's just a matter of displaying it.

Any tips would be greatly appreciated!

Adding the following code:

$results = $readConnection->fetchAll($query);

foreach($results as $result)
{
   echo "<pre>";
   print_r($result);
}

returns this:

Array
(
    [value] => User 1
    [SUM(DISTINCT(base_order_total))] => 10027.4500
)
Array
(
    [value] => User 2
    [SUM(DISTINCT(base_order_total))] => 6796.8500
)
Array
(
    [value] => User 3
    [SUM(DISTINCT(base_order_total))] => 6179.2000
)
Array
(
    [value] => User 4
    [SUM(DISTINCT(base_order_total))] => 5897.1100
)
Array
(
    [value] => User 5
    [SUM(DISTINCT(base_order_total))] => 4178.6100
)

So I'm almost there, I just need to get rid of the unnecessary text so that I can then style it myself in the .phtml


texts: Terms of use button in installation not responding for 1.9.2.1

texts:
I wanted to install a fresh Magento so:

After copying gzip 1.9.2.1 full installation to ftp folder, I changed the premissions for all files in root magento folder /shop/ to 644.
After going to the address, installation page shows with terms of use and after marking the check mark I wanted to click continue, but it doesn't respond.

Can't install Magento on a same server where 1.9.0 and 1.4 were installed.


texts: Magento 2 Installation step 6 still Stops at 2% !


texts:
When i have sending magento order mail, following exception generated at every time. how to fix it ?

2016-06-23T03:58:08+00:00 ERR (3): exception 'Zend_Mail_Transport_Exception' with message 'Unable to send mail. ' in /home/embiconi/public_html/lib/Zend/Mail/Transport /Sendmail.php:137 Stack trace:
0 /home/embiconi/public_html/lib/Zend/Mail/Transport/Abstract.php(348):
Zend_Mail_Transport_Sendmail->_sendMail()
1 /home/embiconi/public_html/lib/Zend/Mail.php(1194):
Zend_Mail_Transport_Abstract->send(Object(Zend_Mail))
2 /home/embiconi/public_html/app/code/core/Mage/Core/Model/Email
/Queue.php(241): Zend_Mail->send()
3 [internal function]:
Mage_Core_Model_Email_Queue->send(Object(Mage_Cron_Model_Schedule))
4 /home/embiconi/public_html/app/code/core/Mage/Cron/Model
/Observer.php(326): call_user_func_array(Array, Array)
5 /home/embiconi/public_html/app/code/core/Mage/Cron/Model
/Observer.php(72): Mage_Cron_Model_Observer->_processJob(Object(Mage_Cron_Model_Schedule), Object(Mage_Core_Model_Config_Element))
6 /home/embiconi/public_html/app/code/core/Mage/Core/Model/App.php(1357):
Mage_Cron_Model_Observer->dispatch(Object(Varien_Event_Observer))
7 /home/embiconi/public_html/app/code/core/Mage/Core/Model/App.php(1336):
Mage_Core_Model_App->_callObserverMethod(Object(Mage_Cron_Model_Observer), 'dispatch', Object(Varien_Event_Observer))
8 /home/embiconi/public_html/app/Mage.php(448):
Mage_Core_Model_App->dispatchEvent('default', Array)
9 /home/embiconi/public_html/cron.php(76): Mage::dispatchEvent('default')
{main}


texts: How to get name and email address of all the customer from beginning of the store?

texts:
I am working on magento1.7.
Every single order has a customer name and email address saved within it.
 However I guess, Magento only shows these details in the Customers > Manage Customers section if that person has created an account.

If the customer checked out as a guest then their name and email address are only saved within the order in the database.

so I am unable to find the list of all customer.

Is it possible to have a query that will scan every single order within the back end and get the customer's full name, their email address and order date ?

I want to find all the customer who has made orders (both as a registered user or guest) from the beginning of the store..

Could any one suggest some query ?


texts: How to skip or ignore field in a Magento 2.3.4 import

texts:
I would like to update some products in Magento 2.3.4 admin>system>import. My import file doesn't have category info for items that are already in the database where they are assigned to a category.
I am concerned that if I leave the field blank it will clear the settings for the skus already in the data.
1-Can I remove the category column in the import file?
2-Is there something I can put in the field so it skips or ignores the column and does not update existing data for that field?


texts: How to hide Sorry, no quotes are available for this order at this time before enter address?

texts: How to hide the Shipping message before entering ZIPCODE in Magento 2.


texts: Magento 2: How do I hide a column from an admin grid?

texts: Using 2.1.3, is there a way to hide an entire column from a UI component admin grid? I found Magento2 Add css class to admin ui grid column, and that hides the column, but not the column header (misaligning the grid columns).


texts: magento 2 Csrf form validator does not work

texts:
My form's Csrf does not validate and always returns null.

if($this->formKeyValidator->validate($this->getRequest())){
   //do something
}

i looked into the matter and found that my custom form's Csrf key is returning a different value from the value produced from the validator key:

\magento\framework\Data\Form\FormKey\Validator::validate

this is what i did:

Block :

namespace Test\Aup\Block\Registration;
class AccountDetails extends Template
{
    protected $formKey;

    public function __construct(
        \Magento\Framework\View\Element\Template\Context $context,
        \Magento\Framework\Registry $registry,
        \Magento\Framework\Data\Form\FormKey $formKey,
        $data = []
    ) {
        $this->formKey   = $formKey;
        $this->_registry = $registry;

        parent::__construct($context, $data);
    }
    public function getFormKey()
    {
      return $this->formKey->getFormKey();
    }
}

View:
Test\Aup\view\frontend\templates\registration\accountdetails.phtml

 <form autocomplete="off" method="post" autocomplete="off" action="/Test/Aup/"  class="container">
     <input type="hidden" name="form_key" value="<?php echo $block->getFormKey() ?>" />

        <input  type="submit" name="submitregister" value="Continue" class="button continue"></input>

  </form>

controller:

 namespace Test\Aup\Controller\Registration;
 Class Index extends \Magento\Framework\App\Action\Action

{
    protected $formKey;
    protected $formKeyValidator;

    public function __construct(
        \Magento\Framework\App\Action\Context $context,
        \Magento\Framework\View\Result\PageFactory $pageFactory,
        \Magento\Framework\Data\Form\FormKey\Validator $formKeyValidator,
        \Magento\Framework\Data\Form\FormKey $formKey
    )
    {
        $this->formKeyValidator  = $formKeyValidator;
        $this->formKey           =  $formKey;
        $this->_pageFactory      = $pageFactory;
        return parent::__construct($context);
    }

    public function execute()
    {
          echo "formKey produced from the validator: \Magento\Framework\Data\Form\FormKey\Validator";
          var_dump($this->formKey->getFormKey());

        $formKeyForValidation = $this->getRequest()->getPostValue('form_key');

        echo "post returned form Key";
        var_dump($formKeyValidator);die();

        $validFormKey = $this->formKeyValidator->validate($this->getRequest()); die();
    }
}

The two values produce totally  different numbers. Consequently this test is failing :

$this->formKeyValidator->validate($this->getRequest()))

My Magento is installed on wampp.


texts: mysql update of sales_flat_quote suddenly gets very slow

texts:
I have a problem with a magento 1.9 installation behind a varnish cache. The load average is rougly 500 request/minute (including ajax requests and esi callbacks).

Normally, I get ~200-250 UPDATE queries per minute for sales_flat_quote. Under normal circumstances, these only takes about 1 ms to finish. However, I have a problem where all of these updates at times takes 5-30 seconds to finish.

During these spikes, all page loads grinds to a halt, but the overall system load is lowered (from ~20 to ~12), as is cpu usage. Mysql never uses more than 70-80 % of a single CPU during these spikes (with 32 CPU cores available), and there are plenty of available RAM, with innodb_buffer_pool = 10G but only 6G used. The number of UPDATE queries are pretty much unaffected. In fact, they tend to be slightly lower at ~200 queries/second.

Restarting mysql or php-fpm doesn't solve this problem. The only way I am able to solve it is by rebooting the entire server, which is not an acceptable solution.

Furthermore, the sales_flat_quote table is routinely truncated and only contains ~ 5000 rows.

The source of these updates all comes from the cart and the checkout.


texts: Magento 2.3.X - Required PHP extension 'Imagick' was not loaded

texts:
Magento 2.3.2 when I set image adapter for ImageMagick images on front-end not load Shows placeholder.

When I run

bin/magento catalog:image:resize

it says Required PHP extension Imagick was not loaded.


texts: Magento 2 display custom images from category page in list page

texts: In Magento 2 how to display custom category image in list page


texts: How to add a new tab into Customer's Dashboard on M2 frontend

texts:
I need to create a new tab in M2's customer dashboard. I tried to do it the way they do in the core: put a xml file in view/frontend/layout

<body>
    <referenceBlock name="customer_account_navigation">
        <block class="Magento\Framework\View\Element\Html\Link\Current" name="customer-account-navigation-my-block-name">
            <arguments>
                <argument name="path" xsi:type="string">module/controller</argument>
                <argument name="label" xsi:type="string">My Tab Name</argument>
            </arguments>
        </block>
    </referenceBlock>
</body>

I also tried the addLink method like in M1 but did not work out also. What is the right way to do this?


texts:
i no that there are many issues regarding with it, but many of the solutions is not quite the same of mine. Im having problems installing magento 1.9. Im running php7, and when magento installation is in the download files section is giving me the error of:

Package community/Lib_ZF_Locale 1.12.10.7: requires PHP version >= 5.2.0 and <= 6.0.0 current is: 7.1.1

Basically because of my php version, i found many solutions like the extension available called "Inchoo_PHP7", but many of the solutions says to replace in the folder "app/...", but in my phase of "download" i dont even downloaded this files or dont exist, so it doesnt work, in my situation, how can i fix the php version when im in the download process of magento?


texts: How to synchronize Magento Cloud environments?

texts:
I have three environments, Production, Staging, and Integration, I'd like to sync Integration DB and Code as its parent environment, which is Staging.
How could I sync the database and the code?


texts: Have a landingpage on a different domain

texts:
My client wants landingpages on a different domain using content within magento. I'm familiar with multi-store setups but this is not ideal becouse of duplicate content and Payment service provider restrictions. What i'm trying to accomplish is showing one CMS page on a different domain. When the visitor clicks a link it has to be redirected to the main domain. Google must also index the links to the main domain.

Any idea's?


texts: How to generate custom amount orders in magento 2?

texts:
I am looking for some solution, Where I can generate custom amount order from back end and directly sent payment invoice to my customer.

I want to sent custom invoice to my every customer, so from backend I can do this and send invoice link to my customer and they can pay.

Is there any way in magento2 to achieve this functionality?


texts:
Magento 1.9 admin and frontend always shows 404 not found
404 not found randomly shows when I'm on admin or on frontend but when I refreshed that certain 404 page it will work fine.
I tried reverting the .htaccess to its original code but it still exist. Tried also disabling/removing some extensions but no luck.

Thank you.


texts: Delete all orders and quotes of customers that do not exist anymore

texts: On our testing environment we are constantly creating new customers and also (mass) removing them again, currently only having 12 customers. Now after a while our sales_flat_order (5038 rows) and sales_flat_quote (5279 rows) tables are really filling up. I want to clean them up with a simple script or SQL query (maybe going to put this in a cron too). Does anyone know how to do this and not miss anything in the clean up?


texts: Filter custom attribute in product collection

texts:
I have created a custom attribute with name product_deisgn_proof.
I want to filter this attribute using product collection in custom template file. When I try to fetch collection of product in an array it gives product_design_proof undefined index.
Here is the code I am using to filter the attribute in product collection.

Please give me a better solution to fetch the product collection with filter attribute.


texts: How can I implement this kind of functionality in magento 1.9

texts:
I have a combo page where first step customer select any of the soles of the shoes and next step to select skins(upper part of the shoes) which having must be select three skins.

Once completed the above mentioned steps, final add to cart page with the final price with specific discount.


texts:
magento 2.2.4 was working absolutely fine with PHP 7.0 and when i upgrade PHP to 7.1 than the frontend is working fine but the backend is giving me below error.

Can anyone please guide me if PHP 7.1 is compatible with magento 2.2.4? and if its compatible than how i can resolve below issue?

thank you


texts: Magento Custom Grid Redirect Error (On Join Attributes ONLY)

texts:
To clarify, this is ONLY on join attributes

My layout handles are correctly setup, I can filter the inherited columns correctly.

$collection->getSelect()->join(
        array('entity_int_status' => 'catalog_product_entity_int'),
        'entity_int_status.attribute_id = 80 AND entity_int_status.entity_id = main_table.product_id',
        array('status' => 'entity_int_status.value')
);

That's how I've joined the status value from catalog_product_entity_int in my Grid. If I try filter by this column, Magento:

On first attempt redirects to the dashboard, and if I then try view the page again
Throws an error report, reading that the column cannot be found

I need to log out & back in again to get the page to load again (i.e forget the filters). Why are the attributes which are joined not able to be filtered?

Edit 1: Please note that this is only for filter, not sort.


texts: switch to currency in magento 2 programmatically

texts:
I'm trying to switch to "euro" in magento2 index.php for some visitors, but i didn't find how to set currency, this is my code :

$bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $_SERVER);
$app = $bootstrap->createApplication('Magento\Framework\App\Http');
$objectManager = $bootstrap->getObjectManager();
$storeManager = $objectManager->create("\Magento\Store\Model\StoreManagerInterface");
$currencyManager = $objectManager->get('Magento\Directory\Model\Currency');


texts: How do I export gallery images using dataflow profiles onto different columns or otherwise

texts:
Hi I'm trying to do a dataflow profile in magento that has all the specs I need.

However I can't separate the images out onto different columns of the csv or by a different type of delimiter within the same column.
Any help with this would be so greatly appreciated.

Is there an extension/script/file anywhere out there that could help me?


texts: What is the max speed of Magento?Or GTMETRIX wrong?

texts:
I have a magento site.I checked it at gtmetrix and it was about 20% both Pagespeed and Yslow.
Now i increased in every possible way you cant say an option that i have not used yet.
You can check it at:

http://gtmetrix.com/reports/modernmarkt.com/eYBgKmtj

And its still wait same change being propogated.Its better than facebook's but the site is still very very very slow surfing between categoires and products.

If you check this site:

http://gtmetrix.com/reports/homesatelit.eu/qYXmXD96

You can see it shows worst even at page load speed but this is is fast as light surfing on it.This sit not use magento.

Also at Gtmetrix you can check the top1000 site and some has about 30% and 90s page load speed but still fast as light.

It seems to me that gtmetrix is useless and to recommends and statics arent count on the real/actual page speed as if you check facebook has a very bad 34%

I've spent a week and money to increase my static and now it seems its not count.
But if its not than what?
What should do?Is there anything i can do?
I use cloud server hosting.

I learn a lot in the past weeks and if you can help figure it out i would write down everything that should be known about Magento speed optimization.


texts: Uses per Customer limit of magento coupons is not working

texts:
I have limit the Uses per Customer to 1 only. But unfortunately it's not working when I used the Free Shipping for matching items. Tested the coupon many times but the store is still  accepting it.

Rule Information:
Customer Groups: General
Uses per Coupon: 1
Uses per Customer: 1
Priority: 0

Currently using Magento CE 1.8.

Does anyone know how to fix this?


texts: Module not working after namespace magento 2

texts:
I used this module

https://github.com/sohelrana09/magento2-module-additional-shipping-block

to add a custom block to the shipment method, when I moved it to another namespace , it does not work any more . It is enabled but the custom block does not show , I changed the namespace "SR" to in all files, cleaned cache, upgraded .. any solutions ?


texts:
I have tested to placed some order using Paypal Standard but order status still show Pending Payment but our Sandbox Paypal account is received money. We also turn on ipn notification.

Our URL: http://www.domain.com
our SSL URL: https://domain.com

Turn ON Notification URL (Paypal Account): http://www.domain.com/default/paypal/ipn/

Our Merchant Platform : Magento ver 1.8.1.0

Which source files should i check and update IPN Url?

I have found so many questions related to this no clue work for me. Please Help !!


texts: Items don't turn out of stock when qty is 0

texts:
I am using magento community 1.7.0.2
I checked in System / Configurations / Catalog / Inventory
"Qty for Item's Status to Become Out of Stock' is set to 0
However I have noticed that all of the products that have been sold out have quantity 0 and status 'in stock'. How do I fix this?


texts: How can I prevent a redirect via custom controller?

texts:
I have a custom form with an action that calls my module controller, I would like to prevent the redirect and stay on the page where the form is submitted but when I try to add a wildcard in my controller index action I get a 'too many redirects error'

$this->_redirect('*/*/');

I've also tried

$this->_redirectReferer();

And

$this->_redirectReferer('*/*/');

Here is my index Action in my module controller

public function indexAction()
{
    $params = Mage::app()->getRequest()->getPost();

    if (isset($params['country'])) {
        $this->setCountry((string)$params['country'], isset($params['hide']));
    }

    if (isset($params['currency'])) {
        $this->setCurrency((string)$params['currency']);
    }
    $this->_redirectReferer();
}

And below is my form which posts to my controller

<form method="post" action="<?php echo Mage::getUrl('locale/switch'); ?>">
    ....
</form>

Is there a better way to have this form submit without redirecting to the controller.


texts: Magento 2 : Add custom error message after csv import

texts:
i am trying to display custom text message after import csv is done in On the Admin sidebar, go to System > Data Transfer > Import.
The messages appears but on reload page.
Any thoughts how can i display messages ?
protected function _importData(): bool
    {
        switch ($this->getBehavior()) {
            case Import::BEHAVIOR_APPEND:
                $complete['notice'] = array(
                    0 => 'Could not load Order ID "2120621" for row no: 2',
                    1 => 'Unable to create credit memo for order #000000025.',
                    2 => 'Could not load Order ID "212062154" for row no: 4',
                );
                foreach ($complete['notice'] as $value) {
                   $this->messageManager->addNotice(__("Notice"));
                }
        }
        return false;
    }


texts:
So, I set a custom admin URL in the local.xml and everything works fine in Firefox, but when I log-in through Chrome from http://www.example.com/customurl I land on a 404 site in the admin panel.

I can use the admin navigation bar and use everything as normal, it's just annoying landing here:

first and other employees might think something is wrong.

Another thing I found out is, that if I use http://www.example.com/admin/customurl it works as it should.

Any suggestions?


texts: Products not showing in secondary store?

texts:
We are running on Magento 1.7 and have two stores.  We are looking to sell different products on the two different websites but a very select few products will be available on both.  In this example the "Single Heart Pendants"

At Example1.com I have the following:

At Example2.com I have the following:

When I got into the Admin Panel under, Catalog-->Manage Products-->Select the Configurable Product "Custom Make Your Own" I go to Categories thenI have this selected:

and in manage stores I have:

As proof that one of my products is there:


texts: Magento Virtual Product, Parent Product and Child Product Options

texts:
I have been browsing here around for a long time and got the most answers from stack overflow and stack exchange.

Now here is a more complicated one:
I have virtual products, which are for different regions.

Voucher US
Voucher EU
Voucher Asia

I want to get them all into one product.
But each one of them has 3 more options:

Parent Product (Voucher)
VoucherUS
-Option1
-Option2
-Option3
VoucherEU
-Option1
-Option2
-Option3
VoucherAsia
-Option1
-Option2
-Option3

The Costumer would select the Product, then Region, Option1 is based on the region, if Region is US, then Option1 has 5 Options. if Region is EU, then Option1 has 12 Options.
Option2 is same for all regions and Option3 is the Voucher Amount.

I could solve this with 3 different products, each region has its own product. However, I was trying to make the order process more simple. Other websites in the same business, have up to 10 steps until the payment page. We would lower this to 3.


texts:
I'm using Magento 1.9.

If I add a custom option to a product, the thumbnail images for that product no longer appear on the product view page, and you cannot view images 2,3,4, etc  Only the main image is displayed.

i.e. it looks like there's a different product page template being applied for any product where a custom option has been added.

Can anyone advise how to ensure the default product template is being used?

Unless of course, anyone can advise if the custom option is somehow causing an error which is making the thumbnails disappear.

Thanks


texts: Magento 2 adding custom category attribute to backend after being migrated from M1 1.9.4.1

texts:
I have a question regarding a custom category attribute that was added via a module/extension in a Magento 1.9.4.1 webshop and now is migrated correctly to the Magento 2 webshop (2.3.4). I checked the database manually with phpmyadmin to see if the attribute was migrated correctly, since it's not showing up in the backend. I found the attribute with ID 180 and saw that the values were migrated correctly.

I went ahead and changed the frontend template to show these values correctly. That worked out pretty well. It now shows the values correctly on the frontend. FYI this attribute holds some text (a description) regarding the category.

Next thing i wanted to do is, show this attribute in the backend at the category edit page. I'm wondering how this could be achieved. I already told you that in the M1 1.9.4.1 shop, this attribute was added via a custom extension, that uses the mysql installer to install the custom attribute in the database. Since the data is already migrated and in the M2 database, i was wondering: Do i need to create a new custom extension for M2 with the same mysql installer settings for this category attribute?

My worry is that if i do it this way, it will create another category attribute and that i need to transfer the data over to this new attribute. Will the mysql installer see that there already is a category attribute with the name: 'custom_attribute' and ignore the creation of a new attribute and instead just shows the attribute in the backend?

I hope someone can help me with this, since i don't want to ruin a perfect migrated webshop. Thanks in advance :)


texts: Magento 2 : Files responsible for magento checkout process

texts: I'm using a german translation pack but it doesn't translate everything in the Shipping Method Section (in Checkout Process). Which files are responsible for rendering out this section ? I want to change the strings in the Code manually


texts: Magento2 : Product list phtml file for each page

texts:
I want to change the frontend of product list page like in picture below. What file should i change? The product list i mean is each product list in each home page and category page.

Product List :


texts: Parsing error line 39 cron.php while running from command line

texts:
I have set a cron job using cpanel but I have found one issue. My another cron is running as expected and it is firing a testing mail every 5 minutes. I have latest version of magento 1.7.0.2 and I have changed nothing from cron.php file that was provided with magento installation.

When I try to run /usr/bin/php /full/path/to/htdocs/cron.php from terminal, I am getting below error.

Parse error,: syntax error, unexpected T_OBJECT_OPERATOR in /full/path/to/htdocs/cron.php on line 39

I know that there is some issue with mage autoloader but cron.php is untouched and it seems like mage is not being loading while running cron.php through command line.

Please help me. It is really frustrating to me.

BTW, here is the cron.php file.

    <?php
/**
 * Magento
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Open Software License (OSL 3.0)
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/osl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@magentocommerce.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade Magento to newer
 * versions in the future. If you wish to customize Magento for your
 * needs please refer to http://www.magentocommerce.com for more information.
 *
 * @category   Mage
 * @package    Mage
 * @copyright  Copyright (c) 2008 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
 * @license    http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
 */

require 'app/Mage.php';

if (!Mage::isInstalled()) {
    echo "Application is not installed yet, please complete install wizard first.";
    exit;
}

// Only for urls
// Don't remove this
$_SERVER['SCRIPT_NAME'] = str_replace(basename(__FILE__), 'index.php', $_SERVER['SCRIPT_NAME']);
$_SERVER['SCRIPT_FILENAME'] = str_replace(basename(__FILE__), 'index.php', $_SERVER['SCRIPT_FILENAME']);

Mage::app('admin')->setUseSessionInUrl(false);

umask(0);

try {
    Mage::getConfig()->init()->loadEventObservers('crontab');
    Mage::app()->addEventArea('crontab');
    Mage::dispatchEvent('default');
} catch (Exception $e) {
    Mage::printException($e);
}

On line 39, Mage::app('admin')->setUseSessionInUrl(false);. TIA.

Regards


texts: How do I change/edit the size/shape/color of "Account" and "Cart" Button in an rwd theme?

texts: I have an issue of not being able to figure out how to change the size/shape of the "Account" and "Cart" button in the rwd theme. I have search through the css to no avail as it seems to not directly labeled these two buttons? Anyone figure this out? I like to make these buttons less gaudy as they are to large to suite my theme. I also like to figure how to make them little more rounded. Any Ideas?


texts:
I have my own custom block which extends "Mage_Catalog_Block_Product_View_Options_Type_Select" core block.

With in one of its function I'm using the following code to get priceStr with currency symbol.

$priceStr = $this->_formatPrice(array(
                'is_percent'    => ($_value->getPriceType() == 'percent'),
                'pricing_value' => $_value->getPrice(($_value->getPriceType() == 'percent'))
            );

Every thing is working perfect except when the price is 0.0000 it returns "" (empty)

I would like it to return $0.00 when the price is 0


texts: Magento 2 how to run reindex for single product or some cart line products

texts:
Is there any way in magento to achieve to reindex only single product or some items.

I have a inventory existing /update call on product page load and cart page load.

Right now doing indexing for all catalog on product page and cart page which is not feasible way.

Any way that can be done get this done?


texts: Exception Error: Could not determine temp directory, please specify a cache_dir manually

texts:
Tried to install magento 1.8.1 to my hosting server. Everything look fine in the frontend, and I can login to backend and add category. However when I try to modify it(e.g: Catalog>Manage Products)in the backend its getting exception printing is disabled by default for security reasons. Did I make anything wrong during the installation? Don't know how to fix it!
Thank you very much!

a:5:{i:0;s:71:"Could not determine temp directory, please specify a cache_dir manually";i:1;s:4121:"#0 /home/greenlight/www/www/ftp/magento/lib/Zend/Cache/Backend.php(197): Zend_Cache::throwException('Could not deter...')


texts: Adblock extension blocks Magento product images

texts:
I have realized that the Adblock extension blocks all my product item images from this Magento site.

I want to make my site visible also for users with the Adblock extension installed. The problem is that AdBlock filters all 180x150 images in the cavalet.bg/media/catalog/product/cache/1/small_image/180x150 folder.

How can I change the path where all my product images are saved? What can I do with all my images already saved in 180x150 folder?

Many thanks!


texts: How can I remove jQuery in js folder from Magento layout

texts:
I have added this code to remove jQuery.1.6.4 in my js folder. But it does not remove Jquery.

In my local.xml file I've put:

<reference name="head">
    <action method="removeItem"><type>js</type><name>js/VS/jquery-1.6.4.min.js</name></action>
</reference>

But this is not working.


texts: Disable the Sidebar on Product View Page

texts:
I’m using Porto 3.1.6 for Magento 2.3.

In the product view page on mobile, there is a sidebar that is shown when pressing an arrow on the right. Please see the attached images to see what I am talking about.

How can I disable that sidebar? I don’t want a sidebar, instead, I want the information to show at the bottom of the page, without a sidebar, like it does on regular desktop view.

Please see the attached images. The sidebar I'm talking about is triggered by the arrow circled in red.


texts: Item with the same ID "860" already exists

texts:
1 exception(s): Exception #0 (Exception): Item (Magento\Catalog\Model\Product\Interceptor) with the same ID "860" already exists.
I am using Magento 2.2.2 .

When switched to developer mode, I got this error. I tried searching for solution but found nothing.

How can I solve it? Much appreciated your help.


texts: Why Magento Core team doesn't notify us when modifies duplicate customer email addresses in upgrade script?

texts:
I was monitoring SQL queries during upgrade from Magento 1.5 to Magento 1.9.2.1

I noticed that in upgrade-1.6.2.0.1-1.6.2.0.2.php of Customer module Magento Core team modifies all duplicate customer email addresses in order later to add unique index:

ALTER TABLE `customer_entity` ADD UNIQUE `UNQ_CUSTOMER_ENTITY_EMAIL_WEBSITE_ID` (`email`,`website_id`)

Before upgrade script is executed we have:

+-----------+------------+---------------------+
| entity_id | website_id |         email       |
+-----------+------------+---------------------+
|   65477   |      1     | mailbox@example.com |
|   65478   |      1     | mailbox@example.com |
+-----------+------------+---------------------+

After upgrade script is executed we have:

+-----------+------------+-------------------------------------+
| entity_id | website_id |                  email              |
+-----------+------------+-------------------------------------+
|   65477   |      1     |                 mailbox@example.com |
|   65478   |      1     | (duplicate65478)mailbox@example.com |
+-----------+------------+-------------------------------------+

My question is: "Is this operation safe enough and is there any possibility that active customers could not be able to login?"


texts:
Assuming Magento is running on Linux, you have a lot of filesystems to choose from. Off the top of my head, there's ext2, ext3, ext4, reiserfs 3 and 4, and xfs. Searching the web for "Magento filesystem comparisons" all I was able to come up with is that you may want to consider tmpfs for the cache directories. But what about the other directories?

Is there any evidence to suggest that one filesystem is significantly better than another, particularly in the context of Magento?


texts: I want testing credentials i.e (Username,Password) of DPD for that I am trying to register on it but it is asking for Account number. How would I get account number for that?


texts:
I want to edit the layout of the search field like change its placeholder, text instead of icon for the search button, etc.

and it seems like its located here:

/www/cleanz-aire/vendor/magento/module-search/view/frontend/templates/form.mini.phtml

I'm working in a child theme so is there any way I can edit it from child theme?


texts: Magento 2 Product Collection with Multi Categories Layered Navigation

texts:
I trying to implement custom layered navigation where the users can filter by more than 1 category (not an easy task in M2), I've managed to display all categories and subcategories at all times and filter the products collection with multiple categories.

I've added:
$collection->addCategoriesFilter(array('in' => $categoriesId)); to app\code\Vendor\Module\Model\Layer\Filter\Category.php
but the problem is that it does not affect the toolbar > meaning pagination and product count on page still show results for a single category.

Even when trying to modify the query itself in app\code\Vendor\Module\Model\ResourceModel\Product\Collection.php > _applyProductLimitations it doesn't work.

I'd appreciate any idea or suggestion to solve this problem.


texts:
I have a file: etc/adminhtml/system.xml where I have added some form fields. However I need to add a custom script being executed while someone types in one of the fields.

How can I include a .js in this page?
It appears I can't simply include it like I would do in a simple xml magento 2 page

<head>
    <css src="Vendor_Module::test.css"/>
    <link src="Vendor_Module::test.js"/>
</head>


texts: How to pass a value to an arrary to be include in Affiliate Tracking URL?

texts:
I am trying to pass an additional value to a string for an affiliate tracking module URL.

The value is a channel ID which should appear after the currency code like as follows:

cr=GBP&ch=aw

The problem is I can't get it to pass, I can see the ch parameter in the url but not the aw

http://www.awin1.com/sread.js?a=5914&b=399.99&cr=USD&c=100000008&d=default:399.99&vc=&t=1&**ch**=&cks=&l=http

Here's my code from system.xml

                <channel>
                    Channel
                    <frontent_type>text</frontent_type>
                    <sort_order>100</sort_order>
                    <show_in_default>1</show_in_default>
                    <show_in_website>1</show_in_website>
                    <show_in_store>1</show_in_store>
                </channel>

First array:

$data = array('tt'      => 'ns',
    'tv'        => '2',
    'merchant'=> $_pr_settings['program_id'],
    'amount'    => $_orderdata['item_total_sale_count'],
    'ref'       => $_orderdata['increment_id'],
    'parts' => implode('|',$parts),
    'vc'        => $_orderdata['coupon_code'],
    'testmode'=> $_settings['test'],
    'cr'        => $_orderdata['global_currency_code'],
    'ch'      => $_setting['channel']);

Image pixel

$html .= '

The sale channel

';

I've been here allday trying to figure out what I've done wrong, any help would be much appreciated.


texts: I have a small problem I can't seem to fix. I have installed Dutch translation. But it also translates City to the dutch word Plaats in the menu. How can I disable this?


texts: Magento 2 Sequence - Multiple Modules Overriding Same Template

texts:
I am using Magento Commerce 2.2.6 running in developer mode.

I have multiple modules that are overriding the same template via the setTemplate action in layout xml. I am using sequence in the modules' module.xml files to control processing order with the intent of controlling which module will ultimately have it's template applied.

UPDATE: It seems Magento is not respecting the sequence specified in these modules. If I manually edit config.php and change the load order (B loads before A) then the modules load correctly/as expected. However, if I then disable and re-enable the modules via cli, Magento rewrites config.php and the order of the modules is switched back (A loads before B).

Below I have copied the module.xml and layout files from each of the conflicting modules:

Vendor_A module.xml:

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd">
    <module name="Vendor_A" setup_version="1.0.0"/>
    <sequence>
        <module name="Vendor_B" />
        <module name="MageWorx_Downloads" />
    </sequence>
</config>

Vendor_A catalog_product_view_type_grouped.xml:

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <referenceBlock name="product.info.grouped.options">
        <action method="setTemplate">
            <argument name="template" xsi:type="string">Vendor_A::product/view/type/grouped.phtml</argument>
        </action>
    </referenceBlock>
</page>

Vendor_B module.xml:

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd">
    <module name="Vendor_B" setup_version="1.0.0"/>
    <sequence>
        <module name="Aitoc_GroupedProductsOptions" />
    </sequence>
</config>

Vendor_B catalog_product_view_type_grouped.xml:

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <referenceBlock name="product.info.grouped.options">
        <action method="setTemplate">
            <argument name="template" xsi:type="string">Vendor_B::product/view/type/grouped.phtml</argument>
        </action>
    </referenceBlock>
</page>

It is my expectation that Vendor_A would have it's template applied because the sequencing specifies for it to be loaded after Vendor_B. However, the opposite is true.

If I comment out the setTemplate action in Vendor_B, then Vendor_A has it's template applied so it seems everything works except sequencing.

Does sequencing not work in the way I think it does or am I making some other erroneous error?


texts:
I am Trying to add custom price on add to cart for product. It worked successfully but on shopping cart page - currency change stopped working. It just change currency symbol. Price conversation doesn't work. Below is used raw code.

$item->setCustomPrice($params['final_price']);

$item->setOriginalCustomPrice($finalPrice);

$item->getProduct()->setIsSuperMode(true);

Above code is added in ""checkout_cart_product_add_after"" event.


texts: Is there a definitive guide/walkthrough out there on upgrading from EE 1.12.0.0 to EE 1.13.1.10

texts:
I have been looking around for a couple days now and I have not been able to find a guide that encapsulates the whole process of upgrading from version 1.12.0.0 to 1.13.1.10.

I was wondering if anyone here knew if a guide like that existed somewhere.

Note: I know of the guide on Magento's page, http://www.magentocommerce.com/knowledge-base/entry/ee11302-ce18-install-upgrade,
but I am looking of a different one if it exists.


texts:
I am making changes to Luma theme. I want to move the minicart icon (module-checkout/view/frontend/templates/cart/minicart.phtml) to a different location. <?php echo $this->getLayout()->createBlock('magento_checkout/sidebar'); ?> doesn't seem to work. Do I need to create a module for this? I created a theme by extending Luma and I do all of the changes in app/design/frontend/VendorName/ThemeName/*

I come from Magento 1 and Magento 2 is really new for me.

Thank you.


texts: Get only the first level of child categories

texts:
I would like to list only the first level child categories of the current category.

This is what is have right now:

$_category = Mage::registry('current_category')->getId();
$_categories = $_category
                ->getCollection()
                ->addAttributeToSelect(array('name', 'image', 'description'))
                ->addIdFilter($_category->getChildren());

foreach ($_categories as $_category):
   echo $_category->getName();
endforeach;

The shop is using flat categories, and i have no idea how to show only the first level of child categories.

Been searching a lot but every script i use still show all the sub-sub categories instead only the sub categories.

EDIT:

Just to be clear

When the current page is:

Category (current page)

-- sub A <-- show this sub category
--- sub A sub
---- sub A sub sub

-- sub B <-- show this sub category
--- sub B sub
---- sub B sub sub

Category

-- sub A (current page)
--- sub A sub <-- show this sub category
---- sub A sub sub

-- sub B
--- sub B sub
---- sub B sub sub


texts: Magento 2: Cacheable false for specific block not working

texts:
I am trying to detect user’s country based on their IP address and ability to change country as well. However with the use of Full Page Cache, country name is not getting display properly. Sometimes it displays random results.

I have tried to add cacheable=false to block XML file. But adding this would slow down entire page. Since this block is added to all pages, entire site getting slow by adding cacheable=false.

Also tried _isScopeprivate = true to my block PHP __construct() function. But this is also not working.

Is there any way to exclude specific block from FPC without hurting site speed?

I have rewrite currency.phtml template for customize my goal,

<referenceContainer name="header.panel">
            <block class="Vendor\Module\Block\Currency" name="currency" template="Vendor_Module::currency.phtml" cacheable="false"/>
</referenceContainer>

when i am keep cacheable=false in above block its working but page load time take so much time.
So I want to remove cacheable="false" from above block.

Any suggestion would be appreciated.
Thanks.


texts: Disable another module from my module xml

texts:
I've a Magento 1.9 shop where a 3rd party module in interfering with my own module. I need to disable the 3rd party module, but due to too-long-to-explain-here reasons I cannot just edit its .xml and set it to <active>false</active>: I actually need to disable said 3rd party module from my own.

I thought I would be easy form my app/etc/modules/Mymodule.xml:

<?xml version="1.0"?>
<config>
    <modules>

        <Mycompany_Mymodule>

            <active>true</active>
            <codePool>community</codePool>

            <depends>
                <3rdparty_Moduletodisable />
            </depends>

        </Mycompany_Mymodule>

        <3rdparty_Moduletodisable>
            <active>false</active>
        </3rdparty_Moduletodisable>

    </modules>
</config>

But this doesn't work: my module gets loaded, but the other one doesn't get disabled.

What am I missing?


texts: Magento 2 Plugin for Contact Form Post Controller

texts:
I have added google recaptcha in my contact form. Also, I have added a contact form on CMS page.

I have to validate the captcha when post contact form.

I have to create a plugin for this, but not much idea how doing this. In plugin have to check condition with captcha. I fail to then add error, otherwise default success message from Magento.


texts: How to change default Magento admin password expiration period?

texts:
Magento prompts the password to be changes after 'X' days.
How to change the value of admin dashboard password expiration period?


texts:
I would like to add a menu item (in the admin panel) to a page which allows to manage pictures.
I found some interesting code in app/code/core/Mage/Adminhtml/Block/Wysiwyg/ and in app/design/adminhtml/default/default/template/cms/browser/.

But as I am very new to Magento, I don't know how to re-use this code.
Should I create a custom module and point the existing block in the config.xml ?


texts: Add products to order programmatically and have payment module see them

texts:
I am building an extension that adds a number of items into an order once the user presses "place order" (after entering all their details.)

I am using the event observer sales_order_place_before

I'm adding the items to Mage::getModel('sales/quote_item') and Mage::getModel('sales/order_item')

The items appear in the order in the frontend and backend correctly.

However, the payment module I'm using (eWay Rapid) does not see the new items.
I confirmed this by turning on the extension debugging where it outputs the items on the order it's processing, my added items ARE NOT there.
I also confirmed that my extension DOES add the items BEFORE the payment module takes over.

I don't think it would be this payment module only, I think it's related to how Magento core works with any payment module when it passes the order details.

How can I add the items to the order and have the payment module aware?


texts: How To pass store view id in upgradeschema

texts:
Hi am trying to add multiple store view id here but its not working any suggestion
upgradedata.php
private function testCmsBlock()
    {
        $data = [
            'title' => 'copyright',
            'identifier' => 'copyright',
            'stores' => ['0','4'],
            'is_active' => 1,
            'content' => '
test
'
         ];
         $this->cmsBlock($data);
     }

this is the line  'stores' => ['0','4'],


texts:
We want to offer a free gift to a specific customer group. So, when someone registers under the specific customer group, the registration form submission will redirect to to the cart page and the free gift will be in the cart. I figured that we can set the price to zero for that customer group.

Can someone tell me how to redirect the registration submission to cart and how to add products to the cart automatically?


texts: how to override /app/code/core/Mage/Catalog/Block/Product/List/Random.php

texts:
I have been trying to override the Random.php file and have looked at inchoo and another method here.  When I do the change on the core file the change takes effect immediately, but when I created the override, the modification do not take effect.

I am trying to override
/app/code/core/Mage/Catalog/Block/Product/List/Random.php. I have created /app/code/local/MyFolder/Catalog/Block/Product/List/Random.php (the modified file).

I have also changed the class name in my override file, to class MyFolder_Catalog_Block_Product_List_Random extends Mage_Catalog_Block_Product_List

I can't figure out how to properly modify app/etc/config.xml file? This is what I have so far.

<config>
 <global>
    ...
    <models>
    ...
    </models>
    <blocks>
        <catalog>
            <rewrite>
                <product_list>MyFolder_Catalog_Block_Product_List_Random</product_list>
            </rewrite>
        </catalog>
    </blocks>
 </global>
</config>

OK it's now functioning.
Changed from:

<rewrite>
    <product_list>MyFolder_Catalog_Block_Product_List_Random</product_list>
</rewrite>

To:

<rewrite>
    <product_list_random>MyFolder_Catalog_Block_Product_List_Random</product_list_random>
</rewrite>

Now I am not sure if there are any other places that needs updating?


texts: Changing from a git to a composer installation

texts:
I'm afraid, I've got a Magento 2 installation which has been done via git. I'm not a developer and would like to upgrade simply via composer update.

Is it somehow possible to move or migrate from one installation/method to the other?

Some more details:
Currently running on 2.1.9
Two extensions installed
Would like to upgrade to 2.2.4


texts:
Ok, so so far I have gotten /admin/helloworld to show up using my module's /etc/config.xml:

<config>
<module>
    <VMR_Reports>
        <version>1.0</version>
    </VMR_Reports>
</module>
<admin>
    <routers>
        <adminhtml>
            <args>
                <modules>
                    <module1 before="Mage_Adminhtml">VMR_Reports_Adminhtml</module1> <!-- Namespace_Module_Subdirectory -->
                </modules>
            </args>
        </adminhtml>
    </routers>
</admin>
</config>

But I don't understand everything that is going on in that example.

1) I know I'm configuring a route, but why ?  I'm pretty sure  isn't a frontName since there is a method of doing this sort of thing where your admin section stuff for a module actually goes into the route, "/module/admin/..." which uses the following sort of XML:

<admin>
    <routers>
        <modulename_admin>
            <use>admin</use>
            <args>
                <module>NameSpace_Modulename</module>
                <frontName>modulename_admin</frontName>
            </args>
        </modulename_admin>
    </routers>
</admin>

So it seems more like  here is a logical section.  Can someone please explain what is going on in the first block of code a little?  All I know is that the result of it is that I get /admin/controller/action to show up where I can specify _Adminhtml if I want to put stuff into Adminhtml subdirectories.


texts:
I am a magento beginner. I created a product group and a product for it.

Then I created a category and assigned the "Grouped product" to it.

Then I created a new page (kleber) and edited the home page to point to it.
The page is still empty though, how can I show all products from the cateogory (ID 4) on that page?

I added this widget to the page "kleber":

But it is not possible to specify the category id and the page stays empty


texts: How to sort / display Reviews based on rating - Magento 2

texts:
I want to display reviews but by sorting them (displaying the highest rating to the lowest rating).
This is how I got the reviews for each product
// Get reviews for each product
    public function getReviewCollection($productId){
        $product = $this->productRepository->getById($productId);
        $collection = $this->_reviewCollection->create()
            ->addStatusFilter(
            \Magento\Review\Model\Review::STATUS_APPROVED
            )->addEntityFilter(
            'product',
            $productId
            )->setDateOrder()
            ->addRateVotes();

        return $collection->getItems(); //Get all review data of product
    }

In my phtml file:
$reviews = $block->getReviewCollection($_item->getID());
if (count($reviews) > 0) {
    foreach ($reviews->getItems() as $review) {
        foreach( $review->getRatingVotes() as $vote ) {
            $ratings[] = $vote->getPercent();
        }
    }
}

How can I sort the reviews based on the $ratings?


texts: How to provide and save data for custom field in gallery.phtm on product edit page

texts:
I have create custom field in admin product edit page image gallery popup in custom module with observer event. Now i want to provide data to this field from table catalog_product_entity_media_gallery_value and save it with observer catalog_product_save_after. How can I do this?

There is my observer

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
<event name="catalog_product_gallery_prepare_layout">
    <observer name="change_template" disabled="true"/>
    <observer name="custom_change_template"
              instance="Module\Vendor\Observer\ChangeTemplateObserver" />
</event>
</config>

use Magento\Framework\Event\Observer;
use Magento\Framework\Event\ObserverInterface;

class ChangeTemplateObserver implements ObserverInterface
{
    public function execute(Observer $observer)
    {
        $observer->getBlock()->setTemplate('Vendor_Module::helper/gallery.phtml');
    }
}

There is part of template:

                        <?= $block->escapeHtml(__('Label')) ?>

                            <input    data-role="image-description"
                                      id="custom_label"
                                      class="admin__control-input">


texts: Magento 2 - Need to filter comma seprated values in addAttributeToFilter along with category filter

texts:
I need to filter comma sperated values in addAttributeToFilter in magento 2

Here is my Code:

$comma_separated_values = 26,27,28,29;

$categoryProducts = $category->getProductCollection()->addAttributeToSelect('*')->addAttributeToSort('position', 'ASC')->addAttributeToFilter('color', $comma_separated_values);

How I can pass in this?


texts:
I got the following error some time on my website and after refreshing the page its work fine...

  with the validation script ReferenceError: validateOptionsCallback is not defined at eval (eval at updateCallback (website.com/js/prototype/validation.js), :1:1) at Function.updateCallback (https://website.com/js/prototype/validation.js:245:13) at Function.test (https://website.com/js/prototype/validation.js:304:18) at eval (https://website.com/js/prototype/validation.js:177:35) at eval (https://website.com/js/prototype/prototype.js:845:37) at eval (https://website.com/js/prototype/prototype.js:825:18) at Array.forEach () at Array.each (https://website.com/js/prototype/prototype.js:824:12) at Array.all (https://website.com/js/prototype/prototype.js:844:10) at Function.validate (https://website.com/js/prototype/validation.js:176:28)

would someone guide me what's wrong or how can I solve this issue?


texts: I have a set of products that I want to apply a buy one get two free with. The idea is that if they purchase one of the items within the set, they get 2 others within the item set for free.


texts:
In my sales > Orders what I'm seeing is order is not continuous it jumps after some orders. Attaching screenshot for your reference

As above you can see that it directly jumps from 000008844 to 000008848. I have gone thought this https://stackoverflow.com/questions/10935117/magento-order-id-increment-jumps but there they have only mentioned theory. I don't want any ordered to be removed. How do I do that?


texts: In magento 2 how to display a form fields in under payment method


texts: How to restore customer data from old data

texts:
I  have delete all customer from  my system

Now i have old a database , i want to restore the customers from this old database

Thus

Customer id  and data are not changed

Can i try this

SET FOREIGN_KEY_CHECKS=0;
 ALTER TABLE `customer_address_entity` AUTO_INCREMENT=1;
ALTER TABLE `customer_address_entity_datetime` AUTO_INCREMENT=1;
ALTER TABLE `customer_address_entity_decimal` AUTO_INCREMENT=1;
ALTER TABLE `customer_address_entity_int` AUTO_INCREMENT=1;
ALTER TABLE `customer_address_entity_text` AUTO_INCREMENT=1;
ALTER TABLE `customer_address_entity_varchar` AUTO_INCREMENT=1;
ALTER TABLE `customer_entity` AUTO_INCREMENT=1;
ALTER TABLE `customer_entity_datetime` AUTO_INCREMENT=1;
ALTER TABLE `customer_entity_decimal` AUTO_INCREMENT=1;
ALTER TABLE `customer_entity_int` AUTO_INCREMENT=1;
ALTER TABLE `customer_entity_text` AUTO_INCREMENT=1;
ALTER TABLE `customer_entity_varchar` AUTO_INCREMENT=1;
ALTER TABLE `tag` AUTO_INCREMENT=1;
ALTER TABLE `tag_relation` AUTO_INCREMENT=1;
ALTER TABLE `tag_summary` AUTO_INCREMENT=1;
ALTER TABLE `tag_properties` AUTO_INCREMENT=1;
ALTER TABLE `wishlist` AUTO_INCREMENT=1;

ALTER TABLE `log_customer` AUTO_INCREMENT=1;**

then import those customer tables from old database**

then set
SET FOREIGN_KEY_CHECKS=1;

Is it good and proper way ? help me?.


texts: Magento 2 How can i get all out of stock product collection?

texts:
I want the collection of products which are out of stock.

In my Magento instance, I used a multisource inventory with multiple stocks and sources.

How can I get this functionality with a custom module?


texts:
I have one multiple select attribute with the name 'recommendations' and I want to get the attribute values in the product list.

I create this code to get values. But now I want to replace i tag with Admin value:   and <?php echo $_target ?> with Default Store View values. How I can get this values separately?

I need to get Admin value and Default Store View in the same code.

<?php  if ($targetValues = $_product->getAttributeText('recommendations')) { ?>

<?php echo $this->__('recommendations') ?>

<?php
if (is_string($targetValues)) {
$targetValues = array($targetValues);
}
foreach($targetValues as $_target) :?>

<i class="<?php echo $_target ?>"><?php echo $_target ?>

<?php endforeach;
 }
?>


texts:
I am trying to use rest api on magento 1.9 from here.

My code is as follows.

    <?php
/**
* Example of simple product POST using Admin account via Magento REST API. OAuth authorization is used
*/
$callbackUrl = "http://yourhost/oauth_admin.php";
$temporaryCredentialsRequestUrl = "http://magentohost/oauth/initiate?oauth_callback=" . urlencode($callbackUrl);
$adminAuthorizationUrl = 'http://magentohost/admin/oauth_authorize';
$accessTokenRequestUrl = 'http://magentohost/oauth/token';
$apiUrl = 'http://magentohost/api/rest';
$consumerKey = 'yourconsumerkey';
$consumerSecret = 'yourconsumersecret';

session_start();
if (!isset($_GET['oauth_token']) && isset($_SESSION['state']) && $_SESSION['state'] == 1) {
    $_SESSION['state'] = 0;
}
try {
    $authType = ($_SESSION['state'] == 2) ? OAUTH_AUTH_TYPE_AUTHORIZATION : OAUTH_AUTH_TYPE_URI;
    $oauthClient = new OAuth($consumerKey, $consumerSecret, OAUTH_SIG_METHOD_HMACSHA1, $authType);
    $oauthClient->enableDebug();

    if (!isset($_GET['oauth_token']) && !$_SESSION['state']) {
        $requestToken = $oauthClient->getRequestToken($temporaryCredentialsRequestUrl);
        $_SESSION['secret'] = $requestToken['oauth_token_secret'];
        $_SESSION['state'] = 1;
        header('Location: ' . $adminAuthorizationUrl . '?oauth_token=' . $requestToken['oauth_token']);
        exit;
    } else if ($_SESSION['state'] == 1) {
        $oauthClient->setToken($_GET['oauth_token'], $_SESSION['secret']);
        $accessToken = $oauthClient->getAccessToken($accessTokenRequestUrl);
        $_SESSION['state'] = 2;
        $_SESSION['token'] = $accessToken['oauth_token'];
        $_SESSION['secret'] = $accessToken['oauth_token_secret'];
        header('Location: ' . $callbackUrl);
        exit;
    } else {
        $oauthClient->setToken($_SESSION['token'], $_SESSION['secret']);
        $resourceUrl = "$apiUrl/products";
        $productData = json_encode(array(
            'type_id'           => 'simple',
            'attribute_set_id'  => 4,
            'sku'               => 'simple' . uniqid(),
            'weight'            => 1,
            'status'            => 1,
            'visibility'        => 4,
            'name'              => 'Simple Product',
            'description'       => 'Simple Description',
            'short_description' => 'Simple Short Description',
            'price'             => 99.95,
            'tax_class_id'      => 0,
        ));
        $headers = array('Content-Type' => 'application/json');
        $oauthClient->fetch($resourceUrl, $productData, OAUTH_HTTP_METHOD_POST, $headers);
        print_r($oauthClient->getLastResponseInfo());
    }
} catch (OAuthException $e) {
    print_r($e);
}

I've replaced yourhost with my host and filled the values for $consumerKey
and $consumerSecret.

I've saved this file as myfile.php.

When I run this script from terminal using command php myfile.php I get

PHP Notice:  Undefined index: state in myfile.php on line 25
PHP Notice:  Undefined index: state in myfile.php on line 29

Script is exiting from within the loop if (!isset($_GET['oauth_token']) && !$_SESSION['state'])

What am I doing wrong?


texts: How to restrict magento footer content to get cached

texts:
I don't want footer content and static blocks to get cached due to
  presence of some dynamic content in it. How Can I do it from code.


texts: How to add a icon before My Account in magento toplinks?

texts:
I have a toplinks in header Magento. I want to add a different icon for "My Account  My Cart  My Wishlist  Login" toplink menus. Please help me with step by step procedure. I am a beginner for magento.
Thanks


texts: Per Store Widget Instance Block References

texts:
I have a multi store magento site set up. There is just the 2 Websites and a single store view each. They both use different themes of the same package.

Now setting up a block in local.xml of Website 1 (The Main Site) for the widgets block reference works fine I can see all my custom layout blocks available to use.

But in the second website in its separate theme if I create another block reference for a widget instance, it doesn't show in the block reference list in admin, but it does still show all the block references for website ones theme...

I have definitely set the layout and theme to point to my second theme for the second website and I'm definitely selecting the correct theme when setting up the widget instance.

You guys have any ideas?


texts:
Dear Magento developers,

Currently I am trying to put an element block on the top of Footer, here is my wanted result:

Here is my default.xml

<referenceContainer name="page.bottom.container">
    <block class="Senheng\Def\Block\Html\Subscribe"
        name="mojambe.footer.top"
        template="Senheng_Default::html/footer/subscribe.phtml"/>
</referenceContainer>

unfortunately nothing is showing up on the home page:

Any help would be very appreciated.


texts: Remove shippping estimation for specific state

texts: I just want to show "contact us" message when customer selects alaska state. just want disable all shipping estimations for this state.


texts: set full width only on a particular category page

texts:
I need to set the particular category page with full width.

Is it is possible with xml and how?


texts: Magento 2 - Add custom js in admin product edit

texts:
I want to add custom js in product edit page (Admin)

Is it ok to add it in some xml or is there any other way to do it?

If it is xml, which XML do I need to work on?


texts:
I need to render inside admin grid preview url for specific store (depends on which store is selected). In Magento 1 the code is this:

$storeId = (int)$this->getRequest()->getParam('store');
if ($storeId == 0) {
    $stores = Mage::app()->getStores(false, true);
    $storeId = current($stores)->getId();
}

$storeCode = Mage::app()->getStore($storeId)->getCode();
$urlModel = Mage::getModel('core/url')->setStore($storeId);
$url = $urlModel->getUrl(
    'banner/index/preview/id/'.$row->getId(), array(
        '_current' => false,
        '_query' => '___store='.$storeCode
   )
);

I ended up with this:

$storeId = (int)$this->request()->getParam('store');
if ($storeId == 0) {
    $stores = $storeManager->getStores(false);
    $storeId = current($stores)->getId();
}

$storeCode = $storeManager->getStore($storeId)->getCode();

But I don't find any code snippet for Magento 2 to migrate $urlModel part of code from Magento 1.

Tnx for any idea.


texts: How to send subscribe email in a custom module in magento2.2.5?

texts:
I have created a custom module, need to send a newsletter subscription email to the consumer in magento2.2.5?
Refer screenshot

Any help would be appreciated.


texts:
I want to add custom success page by overriding it's phtml.
Can anyone guide me how can I do this?


texts: Adding product thumbnail image to Admin catalog > Manage Products area

texts:
How can I add product image thumbnail to Catalog>Manage Categories grid in admin (Magento 1.9.1.1)?

I have already achieved adding product image thumbnails to the Catalog>Manage Products grid via this source. And it works perfectly.


texts:
I have referred this below link.

  Magento- Custom Product labels in category view pages

I Have

created 1 static block name : new_sale
Created 1 Attribute : new_sale

My list.phtml Code--

  app/design/frontend/rwd/default/template/catalog/product/list.phtml

<?php
$collections = Mage::getModel('simplebanner/simplebanner')->getCollection()
->addFieldToFilter('status', array('eq' => 1));
foreach($collections as $collection) {
echo 'getImage().'" height="50" width="50" >';
}
?>

How Would I Create My list.phtml ?
As Per I Give Link Has A list.phtml
But I Wan't To Display My Image.


texts: Magento 1.7.0.2 Customer Address Please enter first name please enter last name

texts:
I'm creating a website for a client, and I ordered a template with demo data from someone in America.

But in the website there is an error.
When I logged in in the site as customer and I'm editing my address there is an error:

Please enter first name
Please enter last name

Although these fields are filled.

Even when you proceed to the basked and paymend through onestep checkout when you fill in your billing information the name is not assiged to the billing and shipping address.

Can somebody please point me in the good direction what to do now?

I'm a developer in .NET so if someone can point me in the good direction of what to do now (in the database or where to look) I will be very thankful.


texts: How can I add item to requisition list even if it is not in stock?

texts:
I would like a user to be able to add items to the requisition list that are not in stock. In the b2b module there is a validatio.php vile with this code-

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

namespace Magento\RequisitionList\Model\RequisitionListItem;

use Magento\RequisitionList\Api\Data\RequisitionListItemInterface;

/**
 * Requisition List Item validation service.
*
 * @api
 * @since 100.0.0
* /
class Validation
{
/**
 * @var ValidatorInterface[]
 */
private $validators;

/**
 * @param ValidatorInterface[] $validators [optional]
 */
public function __construct(
    $validators = []
) {
    $this->validators = $validators;
}

/**
 * Validate list item.
 *
 * @param RequisitionListItemInterface $item
 * @return array
 * @throws \Magento\Framework\Exception\NoSuchEntityException
 */
public function validate(RequisitionListItemInterface $item)
{
    $errors = [];
    foreach ($this->validators as $validator) {
        $errors = array_merge($errors, $validator->validate($item));
        if (count($errors)) {
            break;
        }
    }
    return $errors;
}

/**
 * Is list item valid.
 *
 * @param RequisitionListItemInterface $item
 * @return boolean
 */
public function isValid(RequisitionListItemInterface $item)
{
    return !count($this->validate($item));
 }
 }

Is there any easy way to stop that validation?


texts:
I am building a layered navigation module for my theme based off magento 2 blank. I noticed there is no mobile friendly version of the layered navigation included in this theme.
I have hidden the sidebar on screen width 991. When you click on my toggle button, it sets the sidebar to dispaly:block and position absolute. The goal is to have it take up the entire screen and be able to scroll naturally.
The issue I am running into is that because the sidebar is a child of an element that has Position:relative, I cannot make the toggled sidebar be to the top left of the body. I believe it is hitting the columns or some other content div instead.
I am looking for a solution to either include the navigation sidebar into a brand new block, such as if i were to create a modal or another hidden div with the same behavior inserted through XML wherever i needed it, or I am not sure if it is wise to include in my toggle, change the position of the sidebar in the DOM to the first item in the body and when you close the toggle, move it back to it's original position.
Would it also be wise to just create a separate container and call the layered navigation again through xml, but have it hidden behind a media query? or would this be too much to load? I am looking to keep html elements as low as possible on the page as our site menu is already very large and google is dinging us.


texts: Why I cannot login to my magento admin panel?

texts: My username and password is correct and it only redirects to the login page after I login.


texts: Magento 2: Multi Select using UI-component in Admin Form

texts: How to add this type of multi select in admin form using UI-Component ?