texts: Css can't read content in new area code for theme deploy

texts:
Here is my scenario. I have create new area for my theme (Not adminhtml , frontend). Used Developer mode and no symlinks config in admin

I have create new module simple for define new area theme

  etc/di.xml

<type name="Magento\Theme\Model\View\Design">
    <arguments>
        <argument name="themes" xsi:type="array">
            <item name="vendors" xsi:type="string">Vendor/vendor</item>
        </argument>
    </arguments>
</type>

Just like magento does in frontend and adminhtml
From here i have created new area vendors

Now i go to app\design create new folder vendors and put my theme in that.
My theme path will be

  app\design\vendors\Vendor\vendor

But now problem happen i can't deploy less files
Got issue

  The contents from the
  "/var/www/html/pub/static/vendors/Vendor/vendor/en_US
  /css/styles-m.css" file can't be read

Content of styles-m.less below

@import (reference) 'source/_extends.less';

//
//  Magento Import instructions
//  ---------------------------------------------

//@magento_import 'source/_module.less'; // Theme modules

//
//  Media queries collector
//  ---------------------------------------------

@import 'source/_responsive.less';

@media-target: 'mobile'; // Sets target device for this file

//
//  Global variables override
//  ---------------------------------------------

@import 'source/_theme.less';

//
//  Extend for minor customisation
//  ---------------------------------------------

//@magento_import 'source/_extend.less';

All files less already created and valid but not sure why magento can't read css compiled. I expect compile will success without red error warn


texts: Segmentation fault in CLI when inserting `text` greater than 7000 bytes

texts:
I'm using the following to run a direct insert query in a Magento Shell script.

Mage::getSingleton('core/resource')->getConnection('core_read')->query($q)

One of the string values goes into a text column, and when this string exceeds about 7000 bytes, PHP crashes and a Segmentation fault (core dumped) error occurs.

The 7000 bytes figure is an approximate string size as I was truncating the string in blocks to see at what size an error occurs.

Does anyone have a clue why this happens and how to fix it? The text column accepts much more than 7000 bytes and when I run $q in MySQLyog, it inserts just fine.

The string in question is something like... (array of image URLs imploded with a ,)

http://www.mysite.com/media/catalog/product/cache/0/small_image/135x/images/catalog/product/placeholder/small_image.jpg,http://www.mysite.com/media/catalog/product/cache/0/small_image/135x/images/catalog/product/placeholder/small_image.jpg,http://www.mysite.com/media/catalog/product/cache/0/small_image/135x/images/catalog/product/placeholder/small_image.jpg,http://www.mysite.com/media/catalog/product/cache/0/small_image/135x/images/catalog/product/placeholder/small_image.jpg,... (just repeated ~40 times)

And each of these image URL are obtained via (pesudo code)

foreach list of products {
    $product= Mage::getModel('catalog/product')->load($id);
    $myImgUrl[] = (string)Mage::helper('catalog/image')->init($product, 'small_image')->resize(135);
}

EDIT:
I'd like to add that segmentation fault error occurs whether that particular query is run on the x-th iteration or 1st iteration of the foreach loop.

I also see that at the end of my shell script, memory_get_usage() is over 670 MB.. I see the usage go up at every iteration starting from about 16MB before the first iteration. I am using the same variables, which are used to write to the DB, at every loop.

Update:

I managed to avoid this problem something like below instead of ...->load($id). Fooman provided some insight into this problem in his answer in this thread [Link];

Mage::getModel('catalog/product')->getCollection()
    ->addAttributeToSelect('my_atts')
    ->addAttributeToFilter('entity_id', $id)
    ->getFirstItem();

I understand. Your gist was very helpful. Although it's something I've done before, I didn't realize the memory impact. I replaced all of the ...->load() with your recommendation, ...->getCollection() and everything is well. Memory usage is constant around 16MB and noticeably faster.


texts:
I have a Magento store with 16.000 products and I would like to make some change to all product prices.
First of all I have only Regural Prices so I want to copy all the regural prices to special prices and then increase the regural prices +20%


texts: PHP Startup: Unable to load dynamic library - The specified module could not be found

texts:
I am using WampServer  3.1.0 and PHP version 5.6.31 in windows, i am getting an error like,

php_error :

  [06-Dec-2018 10:13:17 UTC] PHP Warning:  PHP Startup: Unable to load
  dynamic library 'c:/wamp/bin/php/php5.6.31/ext/php_sqlsrv_56_nts.dll'
  - The specified module could not be found.  in Unknown on line 0 [06-Dec-2018 10:13:18 UTC] PHP Warning:  PHP Startup: Unable to load
  dynamic library 'c:/wamp/bin/php/php5.6.31/ext/php_sqlsrv_56_nts.dll'
  - The specified module could not be found.  in Unknown on line 0 [06-Dec-2018 10:13:19 UTC] PHP Warning:  PHP Startup: Unable to load
  dynamic library 'c:/wamp/bin/php/php5.6.31/ext/php_sqlsrv_56_nts.dll'
  - The specified module could not be found.  in Unknown on line 0 [06-Dec-2018 10:13:21 UTC] PHP Warning:  PHP Startup: Unable to load
  dynamic library 'C:/wamp/bin/php/php5.6.31/ext\php_sqlsrv_56_nts.dll'
  - The specified module could not be found.

  in Unknown on line 0

  [06-Dec-2018 10:13:21 UTC] PHP Warning:  PHP Startup: Unable to load
  dynamic library 'C:/wamp/bin/php/php5.6.31/ext\php_sqlsrv_56_nts.dll'
  - The specified module could not be found.

  in Unknown on line 0

  [06-Dec-2018 10:13:30 UTC] PHP Warning:  PHP Startup: Unable to load
  dynamic library 'c:/wamp/bin/php/php5.6.31/ext/php_sqlsrv_56_nts.dll'
  - The specified module could not be found.  in Unknown on line 0 [06-Dec-2018 10:13:30 UTC] PHP Warning:  PHP Startup: Unable to load
  dynamic library 'c:/wamp/bin/php/php5.6.31/ext/php_sqlsrv_56_nts.dll'
  - The specified module could not be found.  in Unknown on line 0 [06-Dec-2018 10:13:32 UTC] PHP Warning:  PHP Startup: Unable to load
  dynamic library 'c:/wamp/bin/php/php5.6.31/ext/php_sqlsrv_56_nts.dll'
  - The specified module could not be found.  in Unknown on line 0 [06-Dec-2018 10:13:33 UTC] PHP Warning:  PHP Startup: Unable to load
  dynamic library 'c:/wamp/bin/php/php5.6.31/ext/php_sqlsrv_56_nts.dll'
  - The specified module could not be found.  in Unknown on line 0 [06-Dec-2018 10:13:33 UTC] PHP Warning:  PHP Startup: Unable to load
  dynamic library 'C:/wamp/bin/php/php5.6.31/ext\php_sqlsrv_56_nts.dll'
  - The specified module could not be found.

  in Unknown on line 0

  [06-Dec-2018 10:13:33 UTC] PHP Warning:  PHP Startup: Unable to load
  dynamic library 'C:/wamp/bin/php/php5.6.31/ext\php_sqlsrv_56_nts.dll'
  - The specified module could not be found.

  in Unknown on line 0

  [06-Dec-2018 10:13:36 UTC] PHP Warning:  PHP Startup: Unable to load
  dynamic library 'c:/wamp/bin/php/php5.6.31/ext/php_sqlsrv_56_nts.dll'
  - The specified module could not be found.  in Unknown on line 0

PHP Version : 5.6.31

Php.ini :

https://justpaste.it/57qi2

How can i solve the above error?


texts: Remove Conflict between JQuery and Prototype.js in magento 1.9.1

texts:
I have included all the js library in page.xml of my magento.

<action method="addJs"><script>lib/jquery/jquery-1.10.2.min.js</script></action>
            <action method="addJs"><script>lib/jquery/noconflict.js</script></action>
            <action method="addJs"><script>prototype/prototype.js</script></action>
            <action method="addJs"><script>prototype/validation.js</script></action>
            <action method="addJs"><script>lib/ccard.js</script></action>
            <action method="addJs"><script>scriptaculous/builder.js</script></action>
            <action method="addJs"><script>scriptaculous/effects.js</script></action>
            <action method="addJs"><script>scriptaculous/dragdrop.js</script></action>
            <action method="addJs"><script>scriptaculous/controls.js</script></action>
            <action method="addJs"><script>scriptaculous/slider.js</script></action>
            <action method="addJs"><script>varien/js.js</script></action>
            <action method="addJs"><script>varien/form.js</script></action>
            <action method="addJs"><script>mage/translate.js</script></action>
            <action method="addJs"><script>mage/cookies.js</script></action>

after that also my prototype.js is not working. I have used noconflict.js also. It was working properly before. After merging the js files it is giving the errors.


texts: How to create Custom option programatically in which both are drop-down and they are dependent on each other . Dependent in the sense , changing value of second drop-down option based on the value of first drop-down


texts: $ php bin/magento module:list , returning php version error message while my php version is supported

texts:
It Returning

php bin/magento module:list

  PHP Warning:  Module 'openssl' already loaded in Unknown on line 0

Warning: Module 'openssl' already loaded in Unknown on line 0
Magento supports PHP 5.6, 7.0.2, and 7.0.6 or later. Please read http://devdocs.magento.com/guides/v1.0/install-gde/system-requirements.html

My php version is 7.0.10


texts: Category Attributes, Setup Script and Flat Tables

texts:
I have created a setup script that creates new category attributes.

It works quite well, however after the setup did run, the flat tables are missing the columns and when the Magento API creates the select SQL queries, the Mysql server gives error because the column is not found:

  SQLSTATE[42S22]: Column not found: 1054 Unknown column 'main_table.attribute_column_identifier' in 'field list', query was: SELECT `main_table`.`entity_id`, ...

Now I wonder what the common way is to establish it within the flat tables as well in the setup. I don't want to rebuild manually on the server.


texts:
How to change in Magento date format for Calendar from mm / dd / yyyy to dd / mm / yyyy ?

I have tried change locale, nothing.

Also for Calendar.setup  change setup setting ifFormat: "%Y-%m-%d",

All time same format.

Update

startdate_checkout_step.phtml

<?php $helper = Mage::helper('dv_subscriptions');?>
<?php $startDay = Mage::getStoreConfig('dv_subscriptions/settings/start_day');?>
<?php $days = Mage::app()->getLocale()->getOptionWeekdays(); ?>
<?php $dataObj = new DateTime();?>
<?php $dataObj->setTimestamp(strtotime('next '.$days[$startDay]['label']));?>
<form id="co-checkoutstep-form" action="">

        *<?php echo $this->__('When would you like to receive your first gourmet box')?>

            <input type="date" id="start_date" readonly="readonly" class="required-entry" style="cursor:pointer" name="start_date" min="<?php echo date('d-m-Y')?>" value="" >
            <img style="display:inline" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN)?>/adminhtml/default/default/images/grid-cal.gif" id="start-from-button" />

</form>


texts: How to override the adminhtml template in magento 2 for a specific website in mutiwebsite functionality?

texts:
I have created two website and need to override the adminhtml order view phtml only for the second website. Please suggest how can i achieve this.

Please help. Thanks in advance.

<?php
namespace Vendor\OrderCustomiztion\Block\Adminhtml\Order\View;
use Magento\Framework\View\Element\Template;
use Magento\Eav\Model\AttributeDataFactory;
use Magento\Framework\Exception\NoSuchEntityException;
use Magento\Sales\Model\Order\Address;
class Info extends \Magento\Sales\Block\Adminhtml\Order\View\Info{

/**
     * Customer service
     *
     * @var \Magento\Customer\Api\CustomerMetadataInterface
     */
    protected $metadata;

    /**
     * Group service
     *
     * @var \Magento\Customer\Api\GroupRepositoryInterface
     */
    protected $groupRepository;

    /**
     * Metadata element factory
     *
     * @var \Magento\Customer\Model\Metadata\ElementFactory
     */
    protected $_metadataElementFactory;

    /**
     * @var Address\Renderer
     */
    protected $addressRenderer;
    protected $_storeManager;

    /**
     * Constructor
     *
     * @param \Magento\Backend\Block\Template\Context $context
     * @param \Magento\Framework\Registry $registry
     * @param \Magento\Sales\Helper\Admin $adminHelper
     * @param \Magento\Customer\Api\GroupRepositoryInterface $groupRepository
     * @param \Magento\Customer\Api\CustomerMetadataInterface $metadata
     * @param \Magento\Customer\Model\Metadata\ElementFactory $elementFactory
     * @param \Magento\Sales\Model\Order\Address\Renderer $addressRenderer
     * @param array $data
     */
    public function __construct(
        \Magento\Backend\Block\Template\Context $context,
        \Magento\Framework\Registry $registry,
        \Magento\Sales\Helper\Admin $adminHelper,
        \Magento\Customer\Api\GroupRepositoryInterface $groupRepository,
        \Magento\Customer\Api\CustomerMetadataInterface $metadata,
        \Magento\Customer\Model\Metadata\ElementFactory $elementFactory,
        \Magento\Sales\Model\Order\Address\Renderer $addressRenderer,
            \Magento\Store\Model\StoreManagerInterface $storeManager,
        array $data = []
    ) {
        $this->groupRepository = $groupRepository;
        $this->metadata = $metadata;
        $this->_metadataElementFactory = $elementFactory;
        $this->addressRenderer = $addressRenderer;
         $this->_storeManager = $storeManager;
        parent::__construct($context,$registry,$adminHelper,$groupRepository,$metadata,$elementFactory,$addressRenderer);
        $code= $this->_storeManager->getStore()->getCode();
        if($code == "columbus_app_store_view"){
              $this->setTemplate('Amos_OrderCustomiztion::Info.phtml');
              echo '<pre>';print_r("hie");die();
        }
        else{
           echo '<pre>';print_r("hie2");die();
        }
    }
}


texts: Cant find the css sheet where i can change the colour of the top menu bar

texts:
When you change the size of the screen to phone/tablet it is responsive and has different menu bar, I cant find in any of the css files in my themes sub folder the colour of the hover or buttons it self.

image-displays.com is the site


texts:
With the 2.1.9 and 2.1.8, i just can't access back-office... Even on a clean install.

When i install 2.1.7, or any previous versions, all is ok. I even tried to update a project that is actually on 2.1.7, and i'm facing the same problem...

I'm on a Apache/2.4.10 + PHP 7.0.6

Does anyone faced this pb ?

Edit: it's a Magento 404 error, not an Apache one.


texts: Terminology trivia: Magento "module" or Magento "extension"? What's official?

texts:
New to Magento I was wondering what word to use: "module" or "extension"?

Looking at Mage core code it seems the term "module" is used more by developers, perhaps partly to avoid confusion with "extension" in the sense of "file extension".

But non-programmers in the Magento world seem to favour "extension" over "module".

Is there an officially preferred term?
If not, should we have a Magento community referendum  :-)

What do you think?


texts: Magento - Owebia - Apply conditions for specific list of skus

texts:
Using Owebia, I need to apply a specific fee for certain product skus (from 001 to 099). I know the function I need to use with Owebia, but I don't know how to set the array of skus in the cart:

{
    "special_skus": {
    "label": "Restriction",
    "description": "Restriction",
    "shipto": "UK",
    "conditions": "array_match_any(SKUS_IN_CART), array('001','002'...[...]))",
    "fees": 200
}

Is there a way I can get this list? Should I do it in a different way? My final logic is more complicated: I just simply don't way to allow deliveries to some countries for certain products, but before I do that, I need to get something simpler working.

Thanks!


texts: Magento v1.9 running on Linux - Order canceled, but NOT canceled

texts:
Order shows Canceled, order acknowledgement email NOT sent, but the money was deposited in my account.  Customer did NOT cancel the order, but it looks like the item quantity was changed from 1 to 0.  Same customer successfully placed an order a few hours previously.  Other customer's orders before and after this one had no issues.  Attached annotated screen shot explains it better.

Payments are via PayPal Payments Advanced.

I am the site owner and not a developer so please keep that in mind in your explanations.  THANKS!


texts: Issue with Afterpay Extension - Magento 1.9

texts:
I am using Magento v 1.9.3.10,
We had an error with Afterpay not working last week, so I upgraded to the latest version and it worked ok.
However we couldn't use the other 2 payment methods (Credit card and Paypal). When they are selected in the checkout, the "Place order now" button doesn't do anything.
So I tried to go back to the previous Afterpay version, now it doesn't work and it doesn't let me put the secret key in the backend. it gives an error

  "An error occurred while saving this configuration: Invalid header
  line detected"

both in frontend and Admin.
Any help is appreciated. Thanks heaps


texts: JS error with Braintree - no clientToken?

texts:
I am trying to implement Braintree payments into a Magento 2.1.2 store.

I have followed these guides to set it up, and added in my merchant ID, public and private key:
http://docs.magento.com/m2/ce/user_guide/payment/braintree.html

In checkout, when I click on the Braintree payment method radio button, I get the following JS error:

braintree-2.17.6.min.js:3 Uncaught Error: Braintree API Client Misconfigured: clientToken required.

Shouldn't the client Token be created OK if I've put in all the keys?

This is running in a local dev environment, is that the issue?

Thanks.


texts: Magento Dev - how to ensure real customers/vendors do not receive email

texts:
Would like to ask your opinion - I have a Dev/Testing Server which consists of real vendors/customers data. How can I ensure no real customers/vendors  would receive any testing email e.g. low stock notification, order confirmation, etc.

Magento version. 1.9.2.4


texts: How to echo customer Lifetime Sales on admin Order View page

texts:
I'm looking to display the customer Lifetime Sales value (£) within the admin on admin Order View page. I've managed to pull in the customer total order count with the code below, and basically would like to do the same with the lifetime value

getOrder()->getCustomerId(); $_orders = Mage::getModel('sales/order')->getCollection()->addFieldToFilter('customer_id',$customer_id); $_orderCnt = $_orders->count(); //orders count ?>
(Including this order): '.$_orderCnt.''; ?>

Any ideas?


texts: How can I pull sales orders from a Magento database?

texts: I am having issues with my Magento site and need to pull sales orders from my Magento database. Can anyone help with this?


texts: How to change home_page_header_block identifier?

texts:
I have a static block called:  home_page_header_block

and in it has a JS code for a slider...

In my header.html file;

I have the following code:

**

    <?php echo $this->getChildHtml('topMenu') ?>
    <?php if ($homePageHeaderBlock = $this->getChildHtml('home_page_header_block')) : ?>
    <div class="home_page_header_block">
        <?php echo $homePageHeaderBlock ?>
    <?php endif; ?>

**

So, I want to duplicate this home_page_header_block and change the name of the 2nd one for a 2nd homepage view.

So, for the second block I used the name home_page_header_block2

Under the new homepage.html file for header (different header file)
I tried every variation of the code to look for home_page_header_block2 but it shows nothing.  It works fine with the normal header block name.

What do I have to change from that header.html code for it to look for home_page_header_block2 instead of home_page_header_block?


texts: getUrl - getSkinUrl displaying insecure content on HTTPS pages

texts:
Visitors to my website in HTTPS are receiving messages that some of the content is not secure. Upon investigation it appears that my active template has a getUrl and getSkinUrl code that calls the home button but displays it in HTTP and not HTTPS.

<a href="<?php echo $this->getUrl() ?>"><img src="<?php echo $this->getSkinUrl(); ?>images/Home.gif" alt="<?php echo $this->__('Home');?>"/>

How do I make a call to getUrl and getSkinUrl to generate secure links on secure pages?


texts: I want to remove the four extra padded zeros from the Order id, i.e, Order Id from 000000001 to 00001


texts: Magento 2 Load checkout-cart_configure for different Product page Layout

texts:
My website has 5 types of layout of page,in which 4 types layout of Configure Product and 1 type is Simple Product Page.

I am loading these layout by observer by checking the current category/product page and on the basis of that loading the layout file.

     $layout = $observer->getLayout();
     $layout->getUpdate()->addHandle('catalog_product_view_id_2087');

Everyting is working fine on product page.

Now when I am going to cart page and edit any item from cart page then it call layout file "checkout_cart_configure.xml" file and when open this file you will find code :

<update handle="catalog_product_view"/>
    <body>
        <referenceBlock name="head.components">
            <block class="Magento\Framework\View\Element\Js\Components" name="checkout_cart_configure_head_components" template="Magento_Checkout::js/components.phtml"/>
        </referenceBlock>
        <referenceBlock name="product.info">
            <block class="Magento\Checkout\Block\Cart\Item\Configure" name="checkout.cart.item.configure.block"/>
        </referenceBlock>
        <referenceBlock name="product.info.addtocart">
            <action method="setTemplate">
                <argument name="template" xsi:type="string">Magento_Checkout::cart/item/configure/updatecart.phtml</argument>
            </action>
        </referenceBlock>
        <referenceBlock name="product.info.addtocart.additional">
            <action method="setTemplate">
                <argument name="template" xsi:type="string">Magento_Checkout::cart/item/configure/updatecart.phtml</argument>
            </action>
        </referenceBlock>
    </body>

So my question is you can see the code "" so it called default catalog_product_view.xml file.But in my code there are 5 types xml files.  e.g  catalog_product_view_type_simple.xml , catalog_product_view_type_configurable.xml , catalog_product_view_id_123.xml .....etc.

So it is not called my above files in "checkout_cart_configure.xml" .Hence updatecart.phtml file is not called.

Please let me know in this situation how can handle this.


texts: Force login to access catalog and product pages

texts: Is there a way to force (simply redirect to login page) the user log-in, to access catalog and product pages?


texts: Magento Blocks CMS Home Site right sidebar

texts:
i want to create my own CMS Home site with 2 columns with right sidebar. I added a block under "CMS -> Static Block" with an identifier. I added under CMS -> Pages -> home my own XML Layout:

<reference name="right"><block type="cms/block" name="right.permanent.callout"><action method="setBlockId"><block_id>artmotor_news</block_id></action></block></reference>

The block is shown, but how can i add another block under this block.?

andre


texts:
I am creating a unit test for my simple method, this method get the value from requestHeader

here is my class which I want to create test class

namespace Vendor\Module\Helper;

use Magento\Framework\App\Helper\AbstractHelper;
use Magento\Framework\App\Helper\Context;
use Magento\Framework\App\Request\Http;

class Data extends AbstractHelper
{

    const TEST_VALUE = 'KEYUR';

      public function __construct(
        Context $context,
        Http $request
    )
    {
        $this->request = $request;
        parent::__construct($context);
    }

    // this is the method which I want to write a test case

  public function getTestValue()
    {
        return $this->request->getHeader(self::TEST_VALUE);
    }

}

and here is my test class,

namespace Vendor\Module\Test\Unit\Helper;

use Magento\Framework\App\Request\Http;
use Vendor\Module\Helper\Data;
use Magento\Framework\App\Helper\Context;
use Zend\Http\Header\HeaderInterface as HttpHeaderInterface;

class DataTest extends \PHPUnit\Framework\TestCase
{
    protected $testValue = 'KEYUR';

     /**
     * @var requestHeaderMock|\PHPUnit_Framework_MockObject_MockObject
     */
    protected $requestHeaderMock;

     /**
     * @var Data
     */
    protected $myHelperMock;

     /**
     * @var HttpHeaderInterface
     */
    protected $httpHeader;

     protected function setUp()
    {
        $this->contextMock = $this->createMock(Context::class);
        $this->requestMock = $this->createMock(Http::class);
        $this->httpHeader = $this->createMock(HttpHeaderInterface::class);
        $this->requestMock->method('getHeader')->willReturn($this->httpHeader);

        $this->myHelperMock = new Data(
            $this->contextMock,
            $this->requestMock
        );
    }

    public function testgetTestValue()
    {
        $this->requestMock
            ->expects($this->atLeastOnce())
            ->method('getHeader')
            ->with(Data::TEST_VALUE)
            ->willReturn($this->testValue);

        $this->assertTrue($this->testValue == $this->myHelperMock->getTestValue());
    }

}

But my test case fail with Failed asserting that false is true. I do not know why ? Can someone put some shade on this ?


texts: checkout Helper Url overload not working

texts:
I have a simple need to change all the cart URLs to force it to a store's cart.  I have set it up the same way as all the examples out there, but it's not the data, it the URL I'm trying to get to.  Here is what I have.

The config.xml

<helpers>
  <centralprocessing>
    <class>Wsu_Centralprocessing_Helper</class>
  </centralprocessing>
  <checkout>
    <rewrite>
        <url>Wsu_Centralprocessing_Helper_Url</url>
    </rewrite>
  </checkout>
</helpers>

And the helper file, app\code\local\Wsu\Centralprocessing\Helper\Url.php

class Wsu_Centralprocessing_Helper_Url extends Mage_Checkout_Helper_Url{
    /**
     * Retrieve shopping cart url
     *
     * @return string
     */
    public function getCartUrl(){
        $storeId = 1;//pick up from setting.. look to later but hard code now
        return Mage::app()->getStore($storeId)->getUrl('checkout/cart');
        return $this->_getUrl('checkout/cart');//old function
    }

    /**
     * Retrieve checkout url
     *
     * @return string
     */
    public function getCheckoutUrl(){
        $storeId = 1;//pick up from setting.. look to later but hard code now
        return Mage::app()->getStore($storeId)->getUrl('checkout/onepage');
        return $this->_getUrl('checkout/onepage');//old function
    }
}

As far as I see it, this should be working but it's not.  Any ideas why?
Thank you

UPDATE
As suggested in the post, if the class is being invoked directly i.e. new Mage_Checkout_Helper_Url or if another class is extending it is may fail.  So with that in mind a quick test of the only other spot that has the method  getCartUrl() which is what I need to get at.  The helper file Cart.php (app\code\core\Mage\Checkout\Helper\Cart.php) does have that function in it.  It  extends Mage_Core_Helper_Url.  So I added the helper file in my module app\code\local\Wsu\Centralprocessing\Helper\Cart.php  with

class Wsu_Centralprocessing_Helper_Cart extends Mage_Checkout_Helper_Cart{
    /**
     * Retrieve shopping cart url
     *
     * @return string
     */
    public function getCartUrl(){
        $storeId = 1;//pick up from setting.. look to latter but hard code now
        return Mage::app()->getStore($storeId)->getUrl('checkout/cart');
        return $this->_getUrl('checkout/cart');
    }

}

and adjusted the config to match

<helpers>
  <centralprocessing>
    <class>Wsu_Centralprocessing_Helper</class>
  </centralprocessing>
  <checkout>
    <rewrite>
        <url>Wsu_Centralprocessing_Helper_Url</url>
        <cart>Wsu_Centralprocessing_Helper_Cart</cart>
    </rewrite>
  </checkout>
</helpers>

This didn't help, so that doesn't seem to be the path I need I believe.


texts: Magento 2: How to put default value in yes/no field of widget.xml in magento 2?

texts:
I am creating custom widget in Magento 2. I have created widget.xml file to create this. All things are fine and widget option is showing as well in admin.

Only I want selected value "Yes" instead of "No". Right now it is "No" as default selected value.

Here is the code I am using for select box in widget.xml

<parameter name="chart_layout" xsi:type="select" visible="true" source_model="Magento\Config\Model\Config\Source\Yesno" sort_order="2">
   <label translate="true">Full Width</label>
</parameter>

I am getting below section as screenshot.


texts:
We have change order of image and description on product page.

Default RWD: description = Right  Image =  Left

Our theme:  description = Left  Image = Right

After change this all work fine except zoom. We have change image from left to right but the zoom always chow at right. We are not able to find where is the code to change that in Magento /js/varien/product.js

Any solution?

Thanks in advance!


texts:
In all Magento 2 courses and tutorials recommended to create vendor and then theme in the /app/design/frontend/VENDORNAME/THEMENAME.
http://devdocs.magento.com/guides/v2.1/frontend-dev-guide/themes/theme-create.html for example.
But luma and blank theme are located in /vendors/magento/theme-frontend-luma and /vendors/magento/theme-frontend-blank.

Should and may we place theme in vendors?
When and why we should do so?
If I place new theme it will not be added to DB. Is there any installation procedure, that differs from creation in /app/design/frontend/?


texts: Magento2: Extensions on private bitbucket and Extension Manager not working together

texts:
I have private repositories on bitbucket with my modules which are used in Magento2. All were installed using composer.

In ~/.ssh/config i have:

Host bitbucket.org
IdentityFile ~/.ssh/bitbucket_id_rsa
IdentitiesOnly yes

and in bitbucket_id_rsa is stored key.

My composer.json file under Magento installation looks like this:

"require": {
        "magento/product-community-edition": "2.3.4.0",
        "composer/composer": "@alpha",
        "MYREPO/MYPROJECT": "@dev",
        ...
}
...

"minimum-stability": "dev",
...

"repositories": [
        {
            "type": "composer",
            "url": "https://repo.magento.com/"
        },
        {
                "type": "vcs",
                "url": "git@bitbucket.org:MYREPO/MYPROJECT.git"
        },
        ...
]

Everything is working ok with this configuration, i update module in bitbucket and with composer update i will then update it in Magento.

But now if i want to use also some modules from Magento Marketplace. So in Extension Manager i enter my private and public key from my Magento Marketplace account and i get error in Magento:

  Command "show" failed: In Git.php line 381: Failed to execute git
  clone --mirror 'git@bitbucket.org:MYREPO/MYPROJECT.git'
  '/var/www/vhosts/MYSITE/htdocs/var/composer_ho
  me/cache/vcs/git-bitbucket.org-MYREPO_MYPROJECT.git/' Host key
  verification failed. fatal: Could not read from remote repository.
  Please make sure you have the correct access rights and the repository
  exists. show [--all] [-i|--installed] [-p|--platform] [-a|--available]
  [-s|--self] [-N|--name-only] [-P|--path] [-t|--tree] [-l|--latest]
  [-o|--outdated] [--ignore IGNORE] [-m|--minor-only] [-D|--direct]
  [--strict] [-f|--format FORMAT] [--] [ []]

So it looks like it's trying to use those entered private and public keys from Magento Marketplace and access my bitbucket private repositories with them?
Or is there some other issue? Did anybody have a similar problem?
Thanks


texts: Magento 2 Get Media Gallery in productlist

texts:
In Magento 1 I've always used

$_product->getMediaGallery('images')

But in the source from Magento 2 I see

$productImage = $block->getImage($_product, $image);
echo $productImage->toHtml();

It's only getting the first product image. How do I get the second or third image (not only the base one)?

GetMediaGallery function doesn't exists?

$_product->getMediaGalleryImages() throws NULL in a var_dump

and

for getMediaGallery and getMediaGalleryEntries I get the same notice error:

Undefined property: Magento\Catalog\Model\Product\Interceptor::$getMediaGallery


texts: How to get the product type by the product SKU?

texts:
I have some product SKUs in my custom module and I want to get just the simple products.
I don't want to load each product entity by SKU in a loop to get the product type to avoid performance issues.

How could I filter these products?


texts: File dictating how simple products display on product page

texts:
Was wondering if anyone could point me in the direction of the .phtml file that dictates how simple products are displayed on their parent configurable product pages?

I am running into an issue where the simple product and attributes (images / sku / etc) for these products that are out of stock are being removed from the configurable product page.

Looking at the 'configurable.phtml' file I cannot seem to find where this is.

Any help would be greatly appreciated!

Thanks!


texts: I installed mageplaza smtp extension on m2 EE 2.2.3 (via composer)

texts:
I followed the directions here and installed via composer.
https://github.com/mageplaza/magento-2-smtp

Install via composer (recommend)
Run the following command in Magento 2 root folder:

composer require mageplaza/module-smtp
php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy

It installed two folders in /vendor/mageplaza/

module-core and module-smtp

/vendor/mageplaza/module-smtp/composer.json

    {
  "name": "mageplaza/module-smtp",
  "description": "SMTP Extension for Magento 2 helps the owner of store simply install SMTP (Simple Mail Transfer Protocol) server which transmits the messages into codes or numbers",
  "require": {
    "mageplaza/module-core": "^1.3.10"
  },
  "type": "magento2-module",
  "version": "1.1.3",
  "license": "proprietary",
  "authors": [
    {
      "name": "Mageplaza",
      "email": "support@mageplaza.com",
      "homepage": "https://www.mageplaza.com",
      "role": "Technical Support"
    }
  ],
  "minimum-stability": "dev",
  "keywords": [
    "magento 2",
    "magento 2 smtp",
    "magento smtp",
    "mageplaza",
    "smtp",
    "email settings",
    "gmail smtp"
  ],
  "autoload": {
    "files": [
      "registration.php"
    ],
    "psr-4": {
      "Mageplaza\\Smtp\\": ""
    }
  }
}

/vendor/mageplaza/module-smtp/registration.php

<?php
/**
 * Mageplaza
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the mageplaza.com license that is
 * available through the world-wide-web at this URL:
 * https://www.mageplaza.com/LICENSE.txt
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade this extension to newer
 * version in the future.
 *
 * @category    Mageplaza
 * @package     Mageplaza_Smtp
 * @copyright   Copyright (c) 2017-2018 Mageplaza (https://www.mageplaza.com/)
 * @license     https://www.mageplaza.com/LICENSE.txt
 */

\Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::MODULE,
    'Mageplaza_Smtp',
    __DIR__
);

/vendor/mageplaza/module-smtp/etc/module.xml

<?xml version="1.0"?>
<!--
/**
 * Mageplaza
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the mageplaza.com license that is
 * available through the world-wide-web at this URL:
 * https://www.mageplaza.com/LICENSE.txt
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade this extension to newer
 * version in the future.
 *
 * @category    Mageplaza
 * @package     Mageplaza_Smtp
 * @copyright   Copyright (c) 2017-2018 Mageplaza (https://www.mageplaza.com/)
 * @license     https://www.mageplaza.com/LICENSE.txt
 */
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
    <module name="Mageplaza_Smtp" setup_version="1.1.0">
        <sequence>
            <module name="Mageplaza_Core"/>
        </sequence>
    </module>
</config>

It's not appearing in admin like so:

bin/magento module:status (it's enabled)
app/etc/config.php (double checked it's in there marked with 1)
caching is turned off
developer mode is turned on
bin/magento cache:clean
bin/magento cache:flush
redis-cli flushall

I can't get this module to show up in admin. Any ideas?


texts: Filtering Order Collection using a custom attribute

texts:
I am working on module in which I need to add a custom attribute to the Order Entity but as I tried and failed I found out that Orders Entity is no longer using EAV attributes (or at least EAV table). Is there any way to use custom attribute to filter Orders ?

I am using Magento 1.7.2


texts: Display Product Options change layout of "In Block after info column"

texts:
I'd like to change how the display options look like.
I want them in In Block after info column.

But I don't want all options in rows but I'd like them in 3 or 4 columns.
They are now looking like this:

I'd like them to look like this (below), it would save a lot of space.

Thanks in advance.


texts: How i can show or Hide my block on the basis of data in my database

texts:
I am trying to make a slider in my product view page.. what I need to do is when an admin addon up-sell products from admin panel on front-end I have to check a condition that if a slider entry for upsells products exits in my database I have to run my custom .phtml file where I have made a slider, if a slider entry dose-not exits in database then I have to allow the core block of up-sell product
I have made a slider which is working very well I have strut to make a condition is explained above
need help

i have created a file name as

  Vendor\Module\view\frontend\layout\catalog_product_view.xml

here i have added a block

<block class="Vendor\Module\Block\Frontend\UpSells" name="product.info.upsell" template="Vendor_Module::slider.phtml" >
                <arguments>
                    <argument name="type" xsi:type="string">upsell</argument>
                </arguments>
                <block class="Magento\Catalog\Block\Product\ProductList\Item\Container" name="upsell.product.addto" as="addto">
                    <block class="Magento\Catalog\Block\Product\ProductList\Item\AddTo\Compare" name="upsell.product.addto.compare" as="compare" template="Magento_Catalog::product/list/addto/compare.phtml"/>
                </block>
            </block>

i want this block to run if data user has created a slider for upsell otherwise the core magento block for upsell should work


texts: magento 2 how to override \Magento\Sales\Model\Order\Payment.php

texts: I want to override \Magento\Sales\Model\Order\Payment.php. Guys please help me.


texts: How to create 2 shopping cart rule in magento 1.9.3.2

texts: We are selling dress where with different Category A and B. Category A need to give buy 2 or more to get 15% Off. Category B is flat 10% off on all products. If people buy Category A 1 product and Category B 1 Product, the discount is 10%, but it takes 15%. Can you guide me pls?


texts:
How to URL rewrite the same in Magento2?

<!-- url rewrite -->
 <rewrite>
    <mypage>
        <from><![CDATA[#^/([\w-]+)/m/?#]]></from>
        <to><![CDATA[/m/index/index/product/$1]]></to>
        <complete>1</complete>
    </mypage>
</rewrite>
<!-- end url rewrite -->
<frontend>
<routers>
   <mypage>
      <use>standard</use>
        <args>
           <module>Vendor_Module</module>
           <frontName>m</frontName>
        </args>
   </mypage>
 </routers>

Where should i give this code in magento2

Here, when i hit the controller localhost/mypage/result/index... here im replacing mypage by 'm'

AS:  localhost/m/result/index


texts: Set current product for custom block in category list

texts:
I have added a custom block in each product item, in category list page:

catalog_category_view.xml

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>

        <referenceContainer name="content">
            <block class="Magento\Catalog\Block\Category\View" name="category.products" template="Magento_Catalog::category/products.phtml">
                <block class="Magento\Catalog\Block\Product\ListProduct" name="category.products.list" as="product_list" template="Magento_Catalog::product/list.phtml">
                    <block class="Magento\Catalog\Block\Product\ProductList\Item\Container" name="category.product.addto" as="addto">

                        <block class="Mymodules\Auction\Block\Product\CustomList\AuctionList" name="auction.product.customlist" as="auction-product-customlist" template="Mymodules_Auction::product/list/auction_list.phtml" />

                    </block>
                </block>
            </block>
        </referenceContainer>

    </body>
</page>

Mymodules/Auction/Block/Product/CustomList/AuctionList.php

<?php
namespace Mymodules\Auction\Block\Product\CustomList;

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

    protected $_coreRegistry;

    public function __construct(
        \Magento\Framework\View\Element\Template\Context $context,
        \Magento\Framework\Registry $coreRegistry,
        array $data = []
    )
    {
        $this->_coreRegistry = $coreRegistry;
        parent::__construct($context, $data);
    }

    public function getCurrentProduct()
    {
        return $this->_coreRegistry->registry('current_product');
    }
}

How can I get current product object?

Function getCurrentProduct() above is not working.

Is it possible to pass current product object as an argument in catalog_category_view.xml?


texts: Magento2 - Order collection, How to get billing address?

texts:
I have below code.
$collection = $this->orderCollectionFactory->create()
                //['increment_id', 'global_currency_code', 'status', 'updated_at']
                ->addFieldToSelect('*')
                ->addAttributeToFilter('status', ['in' => [
                    Order::STATE_CLOSED,
                    Order::STATE_COMPLETE,
                    Order::STATE_CANCELED
                ]])
                ->addAttributeToFilter('created_at', ['from' => $result['from'], 'to' => $result['to']]);

            $data = $collection->getData();

How can I get billing address in my collection?


texts:
I am Creating a magento pages and i have imported 20 Products. but i cant able to show the products in homepage.
The following Way i had tried but failed.

{{block type="catalog/product_new" name="home.catalog.product.new" alias="product_homepage" template="catalog/product/new.phtml"}}
{{block type="catalog/product_list" name="home.catalog.product.list" alias="products_homepage" template="catalog/product/list.phtml"}}

after tried the above methods there is an Error appeared

no products Matching

So kindly help me out. .


texts: I would like to find the result count for a certain search word before it gets automatically added to the search term list. I thought it would be simply $query->getResultCount() but this is returning NULL. I'm using Mage::helper('catalogsearch')->getQuery() to get the query before it gets saved in my Mage_CatalogSearch_ResultController.


texts: Exclude caching cusotm module by Magento 2 built in Full page cache(FPC problem)

texts:
I am having a strange issue regarding built-in FPC in magento2.
I have a custom module, in its index controller, it just renders a phtml file. This phtml file shows some information retrieving it from a custom table. This is just a simple thing that I have done here.
The problem is when I disable FPC in magento 2 the contents are displayed correctly, but when I enable the FPC than it renders the blank page .
See below two screeshot for the scenario analysis.

Ok so what I have tried till now.
I read somewhere that including below code on block construct function excludes the block from FPC.
public function __construct(){
$this->_isScopePrivate = true;
}

But it didn't worked.
What i want?
I want to exclude my module from FPC.
Can anyone help me or enlight with some insights?
Thanks.


texts: How to install extensions manually on Windows?

texts: I can install extension manually using the 'mage' shell script on Linux - but is there an equivalent tool for Windows?


texts: Database access error during magento2 installtion

texts:
I am using Ubuntu 16.04 LTS and installed a fresh instance of Mysql.

During the installation, i have kept the root users password as blank.

During Magento 2 installation, I get access denied for the root user.

I tried without the password and by setting a new password.

I get as below:

There is no env.php in app/etc folder at this position.


texts: How to add an option into a custom created dropdown-attribute for category in magento

texts:
I have created a custom dropdown-attribute for magento category with few option, Now I want to add one more option to this select attribute. Is there any way to do this without deleting the existing attribute.

    $setup = new Mage_Eav_Model_Entity_Setup('core_setup');
    $setup->startSetup();

    $setup->addAttribute('catalog_category', 'price_base_unit', array(
        'group'         => 'Order Units',
        'input'         => 'select',
        'type'          => 'varchar',
        'option' => array ('value' => array(
                         'optionone'=> array(
                        0 =>'Bag'),
                            'optiontwo'=> array(
                        0 =>'Kg'),
                            'optionthree'=> array(
                        0 =>'Piece'),
                            'optionfour'=> array(
                        0 =>'Sq. ft'),
                            'optionfive'=> array(
                        0 =>'Cu. ft'),
                            'optionsix'=> array(
                        0 =>'litre'))),
        'label'         => 'Price base unit',
        'backend'       => '',
        'visible'       => 1,
        'required'      => 0,
        'user_defined' => 1,
        'global'        => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
    ));

    $setup->endSetup();


texts: Check if product exists without exception in API

texts:
Is there a way to check whether a product already exists in Magento using the SOAP API that doesn't require using exception handling for the control flow?

I have the following code that works, but I wouldn't say it follows best practices.

Dim productExists As Boolean
Try
    Dim webService As MagentoService = New MagentoWS.MagentoService
    Dim productInfo As catalogProductReturnEntity = webService.catalogProductInfo(sSessionId, sku, String.Empty, Nothing, "sku")
    productExists = True
Catch ex As SoapHeaderException
    productExists = False
End Try

I have to catch the SoapHeaderException and then use the fact that the exception was thrown to know that the product doesn't exist.


texts:
I migrated the database of magento 1.9.x website to magento 2 using the data-migration-tool. After migrating the database the products and categories are displayed at the backend. Now when I cleared my cache am getting an error like

  There has been an error processing your request Exception printing is
  disabled by default for security reasons. Error log record number:
  1863159107

in both frontend and backend. This error is happening for even a small change made at backend or frontend(clearing cache, redindexing) and when I run the command php magento setup:static-content:deploy Its getting error like more than one default website is defined. Someone please help me regarding this issue.
The error in 1863159107 is

 a:4:{i:0;s:40:"More than one default website is defined";i:1;s:2115:"#0   C:\xampp\htdocs\mage2.0.4\vendor\magento\module- store\Model\StoreResolver\Website.php(46):  Magento\Store\Model\WebsiteRepository->getDefault()
#1 C:\xampp\htdocs\mage2.0.4\vendor\magento\module-store\Model\StoreResolver.php(130): Magento\Store\Model\StoreResolver\Website->getAllowedStoreIds(NULL)
#2 C:\xampp\htdocs\mage2.0.4\vendor\magento\module-store\Model\StoreResolver.php(116): Magento\Store\Model\StoreResolver->readStoresData()
#3 C:\xampp\htdocs\mage2.0.4\vendor\magento\module-store\Model\StoreResolver.php(85): Magento\Store\Model\StoreResolver->getStoresData()
#4 C:\xampp\htdocs\mage2.0.4\vendor\magento\module-store\Model\StoreManager.php(151): Magento\Store\Model\StoreResolver->getCurrentStoreId()
#5 C:\xampp\htdocs\mage2.0.4\vendor\magento\module-store\App\Request\PathInfoProcessor.php(39): Magento\Store\Model\StoreManager->getStore('')
#6 C:\xampp\htdocs\mage2.0.4\vendor\magento\module-backend\App\Request\PathInfoProcessor.php(47): Magento\Store\App\Request\PathInfoProcessor->process(Object(Magento\Framework\App\Request\Http), '/')
#7 C:\xampp\htdocs\mage2.0.4\var\generation\Magento\Backend\App\Request\PathInfoProcessor\Proxy.php(95): Magento\Backend\App\Request\PathInfoProcessor->process(Object(Magento\Framework\App\Request\Http), '/')
#8 C:\xampp\htdocs\mage2.0.4\vendor\magento\framework\App\Request\Http.php(161): Magento\Backend\App\Request\PathInfoProcessor\Proxy->process(Object(Magento\Framework\App\Request\Http), '/')
#9 C:\xampp\htdocs\mage2.0.4\vendor\magento\framework\HTTP\PhpEnvironment\Request.php(194): Magento\Framework\App\Request\Http->setPathInfo()
#10 C:\xampp\htdocs\mage2.0.4\vendor\magento\framework\App\Request\Http.php(204): Magento\Framework\HTTP\PhpEnvironment\Request->getPathInfo()
#11 C:\xampp\htdocs\mage2.0.4\vendor\magento\framework\App\Http.php(110): Magento\Framework\App\Request\Http->getFrontName()
#12 C:\xampp\htdocs\mage2.0.4\vendor\magento\framework\App\Bootstrap.php(258): Magento\Framework\App\Http->launch()
#13 C:\xampp\htdocs\mage2.0.4\index.php(39): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http))
#14 {main}";s:3:"url";s:11:"/mage2.0.4/";s:11:"script_name";s:20:"/mage2.0.4/index.php";}

Not only this issue, In magento 2 when I try to change some style in frontend,the styles are getting lost and page is displayed like below

why is this happening?


texts: Accout page links are not showing in mobile

texts:
Once I have logged in our website, I can see the account page with the links. Please see the below screenshot:

But the links are not displaying in mobile view. Please see the below screenshot:

How can i show the links in mobile view?


texts: How to Delete Quote item Based on the condition in magento 2

texts:
I have requirement like below.

I need to read all quote items and their sku, against the custom table,

If value matched, need to delete that quote item and update qty 1 for remaining items but this code is not working for me,

Class DeleteItem extends \Magento\Framework\App\Action\Action{{
 protected $checkoutSession;
 protected $cart;
 protected $_resource;
 public function __construct(
  \Magento\Framework\App\Action\Context $context,
  \Magento\Checkout\Model\Session $checkoutSession,
  \Magento\Checkout\Model\Cart $cart,
 \Magento\Framework\App\ResourceConnection $resource,
 {
   $this->cart = $cart;
   $this->checkoutSession = $checkoutSession;
  $this->_resource = $resource;
   parent::__construct($context);
 }

public function execute() {
   $quote = $this->checkoutSession->getQuote();
            $quoteItems = $quote->getAllVisibleItems();
            foreach($quoteItems as $item) {
                $productSku = $item->getProduct()->getSku();
                $tableSKu  = $this->checkIfExist($productSku);
                if($tableSKu){
                    $item->delete();
                    continue;
                }

                $item->setQty(1);
                $item->save();
            }
        $message = "You alredy bought this Product";
            $this->messageManager->addError(__($message));
            $cartUrl = $this->_url->getUrl('checkout');
            $this->_responseFactory->create()->setRedirect($cartUrl)->sendResponse();
            exit;
       }
public function checkIfExist($productSku){
   $connection = $this->getConnection();
   $sql = "select * from custom_table where sku='".$productSku."'";
   $resultProduct = $connection->query($sql);
   $resultQuery = $resultProduct->fetchAll();

  if(!empty($resultQuery)){
    $parent_sku = $resultQuery[0]['parent_sku'];
    return true;
   }
  }else{
   return false;
    }
    }
 public function getConnection(){
    $connection = $this->_resource->getConnection(\Magento\Framework\App\ResourceConnection::DEFAULT_CONNECTION);
    return $connection;
  }

 }

Right now the item is deleting but if navigated to cart page, the summary being shown right hand side, where item in cart is empty

Can anyone look into this and update me the solution,

Thanks


texts:
How to get selected simple product id in configurable product in magento 2
The below code working fine with Magento 2.3.x version but it not work with magento 2.4.0 version.
requirejs(['jquery','underscore'], function(jQuery,_){
    jQuery(window).load(function(){
        jQuery( ".product-options-wrapper div" ).click(function() {
            selpro();
        });
    });
    function selpro () {
        var selected_options = {};
        jQuery('div.swatch-attribute').each(function(k,v){
            var attribute_id    = jQuery(v).attr('attribute-id');
            var option_selected = jQuery(v).attr('option-selected');
            //console.log(attribute_id, option_selected);
            if(!attribute_id || !option_selected){ return;}
            selected_options[attribute_id] = option_selected;
        });

        var product_id_index = jQuery('[data-role=swatch-options]').data('mageSwatchRenderer').options.jsonConfig.index;
        var found_ids = [];
        jQuery.each(product_id_index, function(product_id,attributes){
            var productIsSelected = function(attributes, selected_options){
                return _.isEqual(attributes, selected_options);
            }
            if(productIsSelected(attributes, selected_options)){
                found_ids.push(product_id);
            }
        });
        console.log(found_ids);
    }
})

;


texts:
I place my code at the top of htacces, but it doesn't work. What did i do wrong?

# Redirect [CODE] [OLD PATH] [NEW PATH]
RewriteEngine On
Redirect 301 /sieraden /dames/dames-accessoires.html

page: http://schoenen-data.eu/dames/dames-accessoires.html


texts: when register in magento2 getting no entity

texts:
when I'm registering magento2 getting an error like

Exception #0 (Magento\Framework\Exception\NoSuchEntityException): No such entity with email = prasad@value22.com, websiteId = 1

Exception #0 (Magento\Framework\Exception\NoSuchEntityException): No such entity with email = prasad@value22.com, websiteId = 1

file path /vendor/magento/module-customer/Model/ResourceModel/CustomerRepository.php line 300
can anyone help me.


texts: filtering product collection on category page based on custom customer attribute

texts:
I've been struggling with Magento\Catalog\Block\Product\ListProduct::initializeProductCollection() from a few days.

I need to filter category product collection based on user's location. So forexample I've to show 2 types of listings: one for location-based(when user's location is set) and other for non-location based (when user's location is not set). The location based listing is basically a filtered set of the product collection. Simply, I don't want to show certain type of product to customer if his location is set.

I've written my custom code to filter product collection but the problem happens when I change the location, it still shows me old collection. I know the full page caching is making issues. I tried making the lifetime of cache ListProduct block as null but still I'm able to see the old collection until I clear the cache.

Question:

Is there a way I can define custom caching process for caching the category page?


texts:
I have a suite of apps, its all distributed - on different subdomains, different boxes, etc..  when I log into one web app, I would like to automatically log the user into our store (magento) as well.  Is this possible to do?

Since the applications are not on the same machine, I don't have access to the Mage files, so I cannot pragmatically log the user in.  I looked into magento's oauth, but I don't want the user to keep confirming to login, since its all supposed to be one seamless experience.


texts: how to get product thumbnail and product url in order confirmation email

texts:
I have tried already mentioned solution for getting product thumbnail image along with product url (link to product)using below solution

/vendor/magento/module-sales/view/frontend/templates/order/items/renderer/default.phtml

<?php echo $_item->getThumbnail(); ?>

<?php echo $this->$_item->getThumbnail()); ?>

<?php echo Mage::getModel('catalog/product_media_config')->getMediaUrl($_item->getThumbnail()); ?>

and on /vendor/magento/module-sales/view/frontend/templates/order/items.html

<?php $_order = $block->getOrder() ?>

<?php $_item = $block->getItem() ?>

<?php $_giftMessage; ?>

    <table class="data table table-order-items" id="my-orders-table" summary="<?php /* @escapeNotVerified */ echo __('Items Ordered') ?>">

<?php /* @escapeNotVerified */ echo __('Items Ordered') ?>

                <?php echo $this->__('Image')?>	 //<-This code
                <?php /* @escapeNotVerified */ echo __('Product Name') ?>

<a href="<?php $_item->getProduct()->getProductUrl(); ?>"> <?= $block->escapeHtml($_item->getName()) ?>

                <?php /* @escapeNotVerified */ echo __('SKU') ?>

                <?php /* @escapeNotVerified */ echo __('Price') ?>
                <?php /* @escapeNotVerified */ echo __('Qty') ?>
                <?php /* @escapeNotVerified */ echo __('Subtotal') ?>

        <?php $_items = $_order->getItemsCollection(); ?>
        <?php $_index = 0; ?>
        <?php $_count = $_items->count(); ?>
        <?php $_giftMessage = ''?>
        <?php foreach ($_items as $_item): ?>
            <?php if ($_item->getParentItem()) {
    continue;
} ?>

but not getting either of product url and product image on order confirmation mail when i tries testing from my end.any solutions?


texts:
I have installed Magento 2.2 on hosted server (rewrite mod is on) and I have since 2 days a problem with .css file.

First of all, I deactivated on MYSQL static sign - "dev/static/sign => 0", so I don't have any "version15...." folder on /pub/static/.

I have cleaned all cache files and deploy all the things, what magento needs:

rm -rf var/view_preprocessed/ var/cache/ var/page_cache/ var/tmp/ var/generation/ pub/static/frontend/
php bin/magento cache:flush
php bin/magento indexer:reindex
php bin/magento setup:upgrade
php bin/magento setup:db-data:upgrade
php bin/magento dev:source-theme:deploy
php bin/magento setup:static-content:deploy

If I launch my page on firefox, I see that Magento want access to https://www.at-handel.at/pub/static/adminhtml/Magento/backend/en_US/extjs/resources/css/ext-all.css
I checked the path and it's correct. I have ext-all.css file on this path, but Firefox/Internet Explorer/Safari don't show me. It's not only on frontend, it's also on backend - https://www.at-handel.at/arkaplan I have also checked the permissons on /var or /pub/static/ - 755

What can I do now??? Please help me.


texts: When I try to remove an item from the minicart I get this popup message: "Attention We can't find the quote item."


texts: Orders below 30,- pay 7,- / above 30,- delivery free

texts:
there are two options: pickup and deliver
pick up there are no delivery costs (duh)
when choosing deliver then orders below 30,- you need to pay 7,- and above 30,- delivery is free.
how can I do this?
do I need to use the picetable?
magento 1.7.0.2

EDIT


texts: Adding/Remove 1 Hour from a line that references date (PHP)

texts:
I'm attempting to debug a Timezone issue in a custom Magento module. One of the tests I would like to try is to ADD/REMOVE 1hr from whatever is output from this line of code.

I suspect ADDING 1hr could be as simple as implementing a "+1" somehow. And perhaps REMOVING 1hr might involve going back 1 Day and forward 23 hours. But honestly, I don't know what to start with this.

Line

$estimatedDeliveryDate = $this->localeDate->date()->setTime(0,0,0);

Context

class Estimator
{
    private $localeDate;

    public function __construct(
        \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate
    ) {
        $this->localeDate = $localeDate;
    }

    public function addEstimatedDeliveryDate(&$items)
    {
        $now = $this->localeDate->date();
        $todayDate = $this->localeDate->date();

         foreach ($items as &$item) {
            $estimatedDeliveryDate = $this->localeDate->date()->setTime(0,0,0);

...


texts: Handling AJAX requests to display template partials

texts:
Pretty new to magento and I'm setting up a custom module to override the core newsletter. All I really want to do is add ajax submit to the form, which is straightforward so far, and also allow the form to be both displayed in a lightbox and on the page, depending on the context of the request. i.e within my custom module controller, would I use something like the below when the request is via AJAX, or is there a more recommended way to do this kind of thing? Thanks for any help

$html = Mage::getSingleton('core/layout')->createBlock('core/template')
            ->setTemplate('my_module/form.phtml')->toHtml();
$this->getResponse()->setBody($html);

EDIT: update after advice from beeplogic. I now get a blank page with the following code. Is there anything obvious I'm doing wrong here?

What I have is a MyCompany_Newsletter_SubscriberController which has a newAction(), overriding core Newsletter controller newAction. My controller action is called fine. I'm trying to target the default newsletter/subscriber/new In my module config.xml, I have:

<frontend>
    <routers>
        <newsletter>
            <args>
                <modules>
                    <MyCompany_Newsletter before="Mage_Newsletter">MyCompany_Newsletter</MyCompany_Newsletter>
                </modules>
            </args>
        </newsletter>
    </routers>
    <layout>
        <updates>
            <newsletter>
                <file>newsletter.xml</file>
            </newsletter>
        </updates>
    </layout>
</frontend>

Then in default/default/layout/newsletter.xml, I have:

<layout>
    <newsletter_subscriber>
        <block type="core/text_list" name="content" output="toHtml" as="content"/>
    </newsletter_subscriber>
    <newsletter_subscriber_new> <!--NOTE: this will be the generated action layout handle -->
        <reference name="content">
            <block type="core/template" template="newsletter/subscribe.phtml" />
        </reference>
    </newsletter_subscriber_new>
</layout>


texts: Magento 2.3.4 UpdateItemsQty controller as well as plugin has wrong store

texts:
Purpose:

Restrict cart item quantity update when total products are more than 10. So I have created around plugin for UpdateItemQty controller which check total quantities and return error when items are more than 10.

Problem:

Error return successfully but problem is it translate error string as per default store. I have checked current store and found that current store is not set. So website shows that I am in en-int store but this controller shows current store is de-de.

UpdateItemQty.php:
<?php
/**
 * @author Ronak Chauhan
 */

namespace MyModule\Checkout\Plugin\Controller\Cart;

use Closure;
use Exception;
use Magento\Checkout\Controller\Cart\UpdateItemQty as ParentClass;
use Magento\Checkout\Model\Cart\RequestQuantityProcessor;
use Magento\Framework\App\RequestInterface;
use Magento\Framework\Serialize\Serializer\Json;
use MyModule\Checkout\Helper\Data;

class UpdateItemQty
{
    /** @var Json */
    protected $json;

    /** @var Data */
    protected $helper;

    /** @var RequestInterface */
    protected $request;

    /** @var RequestQuantityProcessor */
    private $quantityProcessor;

    public function __construct(
        Json $json,
        Data $helper,
        RequestQuantityProcessor $quantityProcessor,
        RequestInterface $request
    ) {
        $this->json = $json;
        $this->helper = $helper;
        $this->request = $request;
        $this->quantityProcessor = $quantityProcessor;
    }

    /**
     * @param ParentClass $subject
     * @param Closure $proceed
     *
     * @return mixed
     */
    public function aroundExecute(ParentClass $subject, Closure $proceed)
    {
        try {
            $cartRequestData = $this->request->getParam('cart');
            $cartData = $this->quantityProcessor->process($cartRequestData);

            if (true) {
                $cartRestrictionError = __(
                    "We are happy that you like so many products! Unfortunately, %1 is the limit for number of items in your shopping cart.",
                    10
                );
                return $subject->getResponse()->representJson(
                    $this->json->serialize(
                        $this->helper->getResponseData(
                            mb_strtoupper($cartRestrictionError, 'UTF-8')
                        )
                    )
                );
            }
        } catch (Exception $e) {
            return $subject->getResponse()->representJson(
                $this->json->serialize($this->helper->getResponseData($e->getMessage()))
            );
        }
        return $proceed();
    }
}

In above around plugin as well as Original controller I have checked current store but getting default store only.
If anyone has idea it would be appreciated. Thanks!


texts: Cart Rules Label not showing when using Table Rates

texts:
I've created the shipping prices using Table Rates.
And I've created a Cart Rule, that when cart total is equal or more than 600, the shipping is free. And I've added a label to the rule, which says "Free Shipping".

Everything works fine! The shipping cost is set to "0", when the total-requirement is met, but the Cart Rule Label isn't showing.

I want it to say "Free Shipping" instead of "Carrier", when the Cart Rules are met.

Is there any work-around for this?

(I've tried activating Free Shipping and setting the minimum amount to 99999999, but then both the "Table Rates" and the "Free Shipping" shippingrules are showing in the cart. And I only want 1 to be shown.)

Thanks in advance.


texts: problems overriding 3rd party extension block class

texts:
the extension in question has the following structure:

app

code

local

MST

Menupro

Block

Base.php

Base.php has:

class MST_Menupro_Block_Base extends Mage_Core_Block_Template {

my custom module

app

code

local

Myname

BlockOverride

Block

Base.php

my Base.php has:

class Myname_BlockOverride_Block_Base extends Mage_Core_Block_Template {

In my module activation file Myname_BlockOverride.xml I have:

<?xml version="1.0"?>
    <config>
        <modules>
           <Myname_BlockOverride>
               <codePool>local</codePool>
                    <active>true</active>
                    <depends>
                        <MST_Menupro/>
                    </depends>
           </Myname_BlockOverride>
       </modules>
    </config>

module is verified as enabled and working because I am overriding some mage core classes also.

in:

app

code

local

Myname

BlockOverride

etc

config.xml

i have:

<?xml version="1.0"?>
    <config>
        <modules>
            <Myname_BlockOverride>
                <version>0.1.0</version>
            </Myname_BlockOverride>
        </modules>

        <global>
            <blocks>
                <myname_blockoverride>
                    <class>Myname_BlockOverride_Block</class>
                </myname_blockoverride>
                <menupro>
                    <rewrite>
                        <base>Myname_BlockOverride_Block_Base</base>
                    </rewrite>
                </menupro>
            </blocks>
        </global>
    </config>

This question has been asked multiple times, like here
https://stackoverflow.com/questions/24145976/how-to-rewrite-extend-a-magento-class-in-an-existing-third-party-extension
and
http://code.tutsplus.com/tutorials/understand-overriding-in-magento-blocks--cms-23325
and
Rewrite a local Extension Module doesn't work

which i've dutifully followed through but seem to up against a brick wall.
my overriding class file is never loaded (error_log at top of file does not fire).

any help greatly appreciated.

edit: i checked through the 3rd party extension for their block definition in config.xml and see

<blocks>
    <menupro>
        <class>MST_Menupro_Block</class>
    </menupro>
</blocks>

not sure if i'm missing a clue there somehow


texts: How to add field value as Email subject in Magent2.2.5?

texts:
I want to add field value as email subject in Magento2.2.5(Refer screenshot)

Here subject field is a select field, if I select option-1 value, The selected value should be the subject for the email to be sent for the contact form.

Any help would be appreciated.


texts:
we are seeing this SQL query in our DB and are unsure what is generating this, we have flat catalog index enabled so it should not be asking for this
sql query select `e`.*, if(at_visibility.value_id > 0, at_visibility.value, at_visibility_default.value) as `visibility`, if(at_status.value_id > 0, at_status.value, at_status_default.value) as `status`, `cat_index`.`position` as `cat_index_position`, `at_inventory_in_stock`.`is_in_stock` as `inventory_in_stock` from `catalog_product_entity` as `e` inner join `catalog_product_entity_int` as `at_visibility_default` on (`at_visibility_default`.`entity_id` = `e`.`entity_id`) and (`at_visibility_default`.`attribute_id` = '102') and `at_visibility_default`.`store_id` = 0 left join `catalog_product_entity_int` as `at_visibility` on (`at_visibility`.`entity_id` = `e`.`entity_id`) and (`at_visibility`.`attribute_id` = '102') and (`at_visibility`.`store_id` = 1) inner join `catalog_product_entity_int` as `at_status_default` on (`at_status_default`.`entity_id` = `e`.`entity_id`) and (`at_status_default`.`attribute_id` = '96') and `at_status_default`.`store_id` = 0 left join `catalog_product_entity_int[...]

anyone knows why is this and where is this being generated from?


texts: Shopping cart and payment method section in backend are blank

texts: So this is my shopping cart and the payment method section where you would be able to configure your methods is also blank. So far we have been unable to figure out why this is happening and all fixes do not work. HELP HELP HELP


texts: Posting form values from phtml to main.php in magento

texts:
Update

Folders are in

app\design\frontend\base\default\template\recipe_creation\index.php

\app\design\frontend\base\default\template\recipe_creation\data.php

Ie) In my .phtml i am posting something like :

        <form action="<?php echo $this->getUrl('mymodule_customerpage/recipeCreation/data.php') ?>" method="post" id="form-validate" autocomplete="off">

                Recipe Creation Page-- Add Recipe.

                 Recipe Name:
                 <input type="text" name="rec_name" id="rec_name" class="form-group2" />

                    Recipe title:
                    <input type="text" name="rec_title" id="rec_title" class="form-group2" />

x Secs

        </form>


texts:
Reindex status is processing

Also index:reset command is not working

Got the error message below


texts:
I've installed Magefan Blog using the composer. So I can't add a new translation to the extension itself.
I tried to add the translations to the theme i18n files on the path app/design/frontend/Vendor/Theme/i18n/ar_SA.csv.

"Blog","الأخبار",module,Magefan_Blog

But it doesn't work.
I've searched the web and find this tutorial:
Translating Magento 2 Extension Using Theme Translation Files
And I've added the following:

"Magefan_Blog:Blog","الأخبار"

But it's not working too.


texts: Magento or condition show error Fatal error: Call to a member function getBackend() on a non-object

texts:
Customer OR Condition query show an error:

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

The Query :

$collection = $this->getCollection();
$collection->addAttributeToSelect('userid')
    ->addAttributeToSelect('firstname')
    ->addAttributeToSelect('lastname')
    ->addAttributeToSelect('profile_image')
    ->addAttributeToSelect('specialist')
    ->addAttributeToSelect('latitude')
    ->addAttributeToSelect('longitude')
    ->addAttributeToFilter('group_id', Federallawyer_Customer_Helper_Data::LAWYER);
if ($name != '') {
    $collection->addAttributeToFilter(array('firstname','lastname'), array(
        array('like'=>'%titlesearchtext%'),
        array('like'=>'%contentsearchtext%')
    ));
}

return $collection;


texts: Magento 2 Import Product custom option drop down values in bulk

texts:
There are some product in my portal and these products require to add custom options of drop down type whose values range is from 1-10000.If we are going to add it one by one it will take so much time.

Can anybody suggest how to do it in bulk?


texts: Opening System->Configuration->Inventory Gives Error

texts:
When I try to open System=>Configuration=>Invengory it gives following error.
There has been an error processing your request

below is the error log in report file

a:5:{i:0;s:97:"Invalid config field backend model: adminhtml/system_config_backend_catalog_inventory_managestock";i:1;s:1704:"#0 C:\xampp\htdocs\my_store\app\code\core\Mage\Adminhtml\Block\System\Config\Form.php(328): Mage::throwException('Invalid config ...')
#1 C:\xampp\htdocs\my_store\app\code\core\Mage\Adminhtml\Block\System\Config\Form.php(229): Mage_Adminhtml_Block_System_Config_Form->initFields(Object(Varien_Data_Form_Element_Fieldset), Object(Mage_Core_Model_Config_Element), Object(Mage_Core_Model_Config_Element))
#2 C:\xampp\htdocs\my_store\app\code\core\Mage\Adminhtml\Block\System\Config\Form.php(164): Mage_Adminhtml_Block_System_Config_Form->_initGroup(Object(Varien_Data_Form), Object(Mage_Core_Model_Config_Element), Object(Mage_Core_Model_Config_Element))
#3 C:\xampp\htdocs\my_store\app\code\core\Mage\Adminhtml\Block\System\Config\Edit.php(92): Mage_Adminhtml_Block_System_Config_Form->initForm()
#4 C:\xampp\htdocs\my_store\app\code\core\Mage\Adminhtml\controllers\System\ConfigController.php(107): Mage_Adminhtml_Block_System_Config_Edit->initForm()
#5 C:\xampp\htdocs\my_store\app\code\core\Mage\Core\Controller\Varien\Action.php(418): Mage_Adminhtml_System_ConfigController->editAction()
#6 C:\xampp\htdocs\my_store\app\code\core\Mage\Core\Controller\Varien\Router\Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('edit')
#7 C:\xampp\htdocs\my_store\app\code\core\Mage\Core\Controller\Varien\Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#8 C:\xampp\htdocs\my_store\app\code\core\Mage\Core\Model\App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#9 C:\xampp\htdocs\my_store\app\Mage.php(684): Mage_Core_Model_App->run(Array)
#10 C:\xampp\htdocs\my_store\index.php(87): Mage::run('', 'store')
#11 {main}";s:3:"url";s:108:"/my_store/index.php/admin/system_config/edit/section/cataloginventory/key/b544589d13d839efa67ab5845e86e613/";s:11:"script_name";s:20:"/my_store/index.php";s:4:"skin";s:5:"admin";}

I have tried by disabling all the extensions i have installed but still no success,

Please guide me if anyone have any idea on what goes wrong


texts: How to add validation for date in Magento 2

texts:
I have this input and i want to add validation for date

  <input class="input-text validate-date" data-validate="{required:true}"
    value: value,
    valueUpdate: 'keyup',
    hasFocus: focused,
    attr: {
        name: inputName,
        placeholder: placeholder,
        'aria-describedby': noticeId,
        id: uid,
        disabled: disabled
    }" name="custom_attributes[amorderattr_birth__date]" placeholder="" aria-describedby="notice-N780KER" id="N780KER" style="

I already added this class class="input-text validate-date" data-validate="{required:true}"> but nothing happen.

Does anyone have any idea how it's the proper way to add date validation for this filed?


texts: inventory_stock_1 doest exist on magento 2.3

texts:
When I go to product pages and checkout the exception shows:

Exception #0 (Zend_Db_Statement_Exception): SQLSTATE[42S02]: Base table or view not found: 1146 Table 'inventory_stock_1' doesn't exist, query was: INSERT INTO `search_tmp_5c4f24124efa61_76233970` SELECT `main_select`.`entity_id`, SUM(score) AS `relevance` FROM (SELECT DISTINCT  `search_index`.`entity_id`, (((0) + (0)) * 1) AS `score` FROM `catalog_product_index_eav` AS `search_index`
 INNER JOIN `catalog_product_entity` AS `product` ON product.entity_id = search_index.entity_id
 INNER JOIN `inventory_stock_1` AS `stock_index` ON stock_index.sku = product.sku
 INNER JOIN `catalog_category_product_index_store1` AS `category_ids_index` ON search_index.entity_id = category_ids_index.product_id AND category_ids_index.store_id = '1' WHERE (search_index.store_id = '1') AND (`search_index`.`attribute_id` = 102 AND `search_index`.`value` in ('2', '4') AND `search_index`.`store_id` = '1') AND (category_ids_index.category_id = 394)) AS `main_select` GROUP BY `entity_id` ORDER BY `relevance` DESC, `entity_id` DESC
 LIMIT 10000
Exception #1 (PDOException): SQLSTATE[42S02]: Base table or view not found: 1146 Table 'inventory_stock_1' doesn't exist

Anyone meet that problem on magento 2.3 ?


texts: Update Shopping Cart button in checkout/cart does not update the quantity when clicked

texts:
Using Magento 1.9.2 - Update Shopping Cart button on checkout/cart page will not update the quantity when clicked.

Numerous posts regarding this issue suggest adding the following code

<?php echo $this->getBlockHtml(‘formkey’); ?>

after

<form action="<?php echo $this->getUrl('checkout/cart/updatePost') ?>" method="post">

in the cart.phtml file.

I did this however it did not fix the issue.

Here is the code for the button:

<button type="submit" title="<?php echo $this->__('Update Shopping Cart') ?>" class="button btn-update"><?php echo $this->__('Update Shopping Cart') ?></button>


texts: Magento 2: How to fetch UI Grid Component using data from external REST API

texts: I wanna know how to fetch data into a UI Grid using external data retrieved from a REST API. Anyone has a step by step solution to achieve this?


texts: How to send email with a file attachment.


texts: Why is Magento not outputting the correct number format?

texts:
I have this:

<?php
foreach($order->getAllItems() as $item):
   if($item->getParentItemId()) continue;
$product = Mage::getModel('catalog/product')->load($item->getProductId());
$profit = $product->getData('profit');
$totalprofit += $profit['total'];
endforeach;
echo $totalprofit;
?>

But instead of outputting 22.95 it outputs 23

How can I get it to output the correct number?


texts: getChildHtml(' ', true, true) - Magento 1.9

texts:
What does it mean these:

1. <?php echo $this->getChildHtml('child.name') ?> // get the child parent block

2. <?php echo $this->getChildHtml('') ?> //?

3. <?php echo $this->getChildHtml('', true, true) ?> //?

4. <?php echo $this->getChildHtml(' ', false, true) ?> //?

5. <?php echo $this->getChildHtml(' ', false, false) ?> //?


texts: How to add Recently visited product in product page left column?

texts:
I want to show recently visited product in product page left column. I am new for magento page customization. Can you guide me a right way?

Working code,

Output:

Now i want to show product image also. Can you guide me for that?


texts: how to add product link on the checkout page order summary magento 2?

texts:
I want to add link on the product which is showing in order summary on checkout page.

I have  found HTML code in the file:

module-checkout\view\frontend\web\template\summary\item\details.html

Code:

How to add href for the product name?


texts: How to display products with limits and offset

texts:
I have displaying products using following url

host/index.php/rest/V1/products?searchCriteria[page_size]=20

Now displaying 20 products in page. i want 20 in first page, 20 to 40 products in second page, 40 to 60 products vice versa. How can i get this?


texts:
i have one legacy module with .html file, which contains label which i'd like to translate.
Originally it looks like this:

text to be translated

i have changed it to:

but this is not helped, it's still not translated.
p.s. cache cleaned, re-deployed, translation exist in csv file.
any ideas?


texts: Contact form emails to multiple recipients

texts: I am trying to find a way to send emails sent by the contact form to multiple email addresses but all the solutions I found involve the edit of the core files and I would like to avoid it. I think that the best way would to extend the contact form but I have no idea on how to do that. Anyone has a clue on how to do that?


texts: Magento2 : Installation error of always_populate_raw_post_data

texts:
I am trying to install Magento 2 and I have php version 5.6 in my system.
When I click on Start Readiness Check , it is displaying error of PHP Settings Check *. I uncommented always_populate_raw_post_data to -1 and restart my apache also but still I am getting same error.

Can anyone help me in this Urgently.


texts: magento 2.1.5 paypal express checkout not work

texts:
When i try to express checkout with pay-pal  ,
i can see the pre loader ,
then it remain at page center and don't see pay-pal page
this happen with magento 2.15 i previously used version 2.13 and it worked well


texts: How to post Order Information to custom Shipping API after a complete Order in checkout using Custom Module

texts: I developed a custom shipping extension for Magento 2.3.5 which works fine but I need to be able to post order details to the API to complete the process. How can I achieve this? I am relatively new to Magento


texts: Give discount % based on products category and quantity in cart

texts:
I am planning to give the below offer. Buy 1 product from X category and 1 product from another category and get 15% off.

I set my cart rules like below both condition and action.

It is working perfectly when there is 1 product from X category and 1 product from Y category but the problem is when there are 2 products from X category and 1 product on Y category it is still calculating 15% discount on total 2*X+1*Y instead of only applying to 1*X+1*Y and bill the other 1*X fully. How to set this condition?


texts: Class 'Magento\TestFramework\TestCase\AbstractController' not found when running unit test for custom module

texts:
I tried to make a unit test for my custom module like this:

app/code/MyCompany/UnitTest/Test/Unit/Controller/SpinTest.php

namespace MyCompany\UnitTest\Controller;

class SpinTest extends \Magento\TestFramework\TestCase\AbstractController
{
    public function testLogin()
    {
        $params = [
          'customer_id' => '3'
        ];
        $this->getRequest()->setPostValue($params);
        $this->dispatch('spin/run');
        $result = $this->getResponse()->getBody();
        $this->assertEquals('200', $result['status']);
    }
}

And ran the unit from terminal:

vendor/phpunit/phpunit/phpunit -c dev/tests/unit/phpunit.xml.dist app/code/MyCompany/UnitTest/Test/Unit/Controller/

But i got an error like this:

  Class 'Magento\TestFramework\TestCase\AbstractController' not found in
  /var/www/mage2/app/code/MyCompany/UnitTest/Test/Unit/Controller/SpinTest.php
  on line 4


texts: Magento : Add Default Note in Invoice PDF

texts: How to add default note to bottom of Invoice PDF or add default image?


texts:
I am developing an extension where is a requirement of add to wishlist without logging into customer account. can anyone help me out in this?

what i think two things can be done here -

1- we can override core function and disable check for customer session.

2- Find an event in magento which can be listened before checking customer session while adding product to wishlist so that i can do my work before it checks whether customer is logged in or not.
Any suggestions will be highly appreciated.

Let me know if i am not clear.


texts: Add a custom section to Category products section in using Custom module magento2

texts:
Can anyone help me, how to add a custom section for category products section using custom module in magento2.

Please find the screenshot below.

Thanks


texts: translation of customized pdfs doesn't work

texts:
I created a module called phil/pdfs to customize the pdf of magento_sales module. Everything works fine but the translation.
Collecting the phrases with i18n tool returns all phrases I want to translate. I put the csv file to

  phil/pdfs/i18n

without success.
If I change the cvs file to en_US the translation works fine. It seems the pdf is generated by the language active in backend. How can I change the translation to language active in storeview?

Somebody knows a solution for this problem?


texts: Magento 2.2.5 Fatal Error in Category and Search Page

texts:
It is a fatal error that happens when I open the search or try to open any category.
I'm using magento 2.2.5 with apache 2.4 and php 7.1

   Fatal error: Uncaught Error: Cannot instantiate interface
   Magento\Framework\Search\Request\IndexScopeResolverInterface in
   /var/www/html/magento2/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:111
   Stack trace: #0
   /var/www/html/magento2/vendor/magento/framework/ObjectManager/Factory/Compiled.php(108):
   Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject('Magento\\Framewo...',
   Array) #1
   /var/www/html/magento2/vendor/magento/framework/ObjectManager/ObjectManager.php(70):
   Magento\Framework\ObjectManager\Factory\Compiled->create('Magento\\Framewo...')
   #2 /var/www/html/magento2/vendor/magento/module-catalog-search/Model/Search/FilterMapper/ExclusionStrategy.php(90):
   Magento\Framework\ObjectManager\ObjectManager->get('Magento\\Framewo...')
   #3 /var/www/html/magento2/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(111):
   Magento\CatalogSearch\Model\Search\FilterMapper\ExclusionStrategy->__construct(Object(Magento\Framework\App\ResourceConnection\Interceptor),
   Object(Magento\Sto in
   /var/www/html/magento2/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php
   on line 111

Question Solved:

A co-worker helped me solve the problem. I inserted this line into the file "app/etc/di.xml":

<preference for="Magento\Framework\Search\Request\IndexScopeResolverInterface" type="Magento\Framework\Indexer\ScopeResolver\IndexScopeResolver"/>


texts:
GTmetrix advises I inline these

<action method="addJs"><script>mage/translate.js</script></action>
<action method="addJs"><script>lib/ccard.js</script></action>
<action method="addJs"><script>prototype/validation.js</script></action>
<action method="addJs"><script>varien/js.js</script></action>

I inlined them to the footer removed the calls in the page.xml and awesome got a A on pagespeed

However I have a webpos extension and it doesn't use the template header or footer so checkout doesn't work unless I replace the call outs in page.xml

So my question is how do i inline these  do i do it in the extensions phtml?


texts:
How do you extend gallery.css in Magento2?

gallery.css is loaded after styles-m.css so anything that I put in my theme's _extend.less the file gets overwritten by it.

I don't want to override everything in it, just a few CSS rules.


texts: Advise on index.php page taking to much resources

texts:
Question that I asked the hosting company:

  admin and website is moving to slow again

Reply from them:

  What hosting has stated: [ We have checked and found that the following page is utilizing high CPU and there is something wrong with index.php lsphp:rnb2/public_html/stuffwholesale.com/index.php ]

This is the page at this address:

<?php
/**
 * Application entry point
 *
 * Example - run a particular store or website:
 * --------------------------------------------
 * require __DIR__ . '/app/bootstrap.php';
 * $params = $_SERVER;
 * $params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE] = 'website2';
 * $params[\Magento\Store\Model\StoreManager::PARAM_RUN_TYPE] = 'website';
 * $bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $params);
 * \/** @var \Magento\Framework\App\Http $app *\/
 * $app = $bootstrap->createApplication(\Magento\Framework\App\Http::class);
 * $bootstrap->run($app);
 * --------------------------------------------
 *
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

try {
    require __DIR__ . '/app/bootstrap.php';
} catch (\Exception $e) {
    echo <<getMessage()}

HTML;
    exit(1);
}

$bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $_SERVER);
/** @var \Magento\Framework\App\Http $app */
$app = $bootstrap->createApplication(\Magento\Framework\App\Http::class);
$bootstrap->run($app);

Thank you.


texts: Magento 2: Observer not redirecting to checkout page

texts:
I have below code of observer

namespace Custom\Module\Observer;

use Magento\Framework\Event\ObserverInterface;
use Magento\Framework\App\Request\DataPersistorInterface;
use Magento\Framework\App\ObjectManager;

class TestObserver implements ObserverInterface {

    protected $_urlManager;
    protected $_checkoutSession;
    protected $_cart;
    protected $_messageManager;
    protected $_redirect;
    protected $_request;
    protected $_response;
    protected $_responseFactory;
    protected $_resultFactory;
    protected $_scopeConfig;
    protected $_product;

    public function __construct(\Magento\Framework\UrlInterface $urlManager, \Magento\Checkout\Model\Session $checkoutSession, \Magento\Framework\App\Response\RedirectInterface $redirect, \Magento\Checkout\Model\Cart $cart, \Magento\Framework\Message\ManagerInterface $messageManager, \Magento\Framework\App\RequestInterface $request, \Magento\Framework\App\ResponseInterface $response, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Catalog\Model\Product $product, \Magento\Framework\App\ResponseFactory $responseFactory, \Magento\Framework\Controller\ResultFactory $resultFactory
    ) {
        $this->_urlManager = $urlManager;
        $this->_checkoutSession = $checkoutSession;
        $this->_redirect = $redirect;
        $this->_cart = $cart;
        $this->_messageManager = $messageManager;
        $this->_request = $request;
        $this->_response = $response;
        $this->_responseFactory = $responseFactory;
        $this->_resultFactory = $resultFactory;
        $this->_scopeConfig = $scopeConfig;
        $this->_product = $product;
    }

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

       // $this->_redirect->redirect($this->_response, $this->_urlManager->getUrl('checkout'));
       // $resultRedirect = $this->_resultFactory->create(ResultFactory::TYPE_REDIRECT);
       // $resultRedirect->setUrl($this->_urlManager->getUrl('checkout'));
       $this->_responseFactory->create()->setRedirect($this->_urlManager->getUrl('checkout'))->sendResponse();
        // $this->_response->setRedirect($this->_urlManager->getUrl('checkout'));
         $this->_checkoutSession->setNoCartRedirect(true); // Redirect to Checkout Page
        return $this;
    }
}

Have tried with $this->_checkoutSession->setNoCartRedirect(true); & $this->_checkoutSession->setNoCartRedirect(false);

Other classes used for my purpose.

Pages loads on Console (Firebug). But not redirecting actually on checkout page.


texts: Magento 2 - Losing data with extension attributes in bundle options collection

texts:
I am using Magento 2.1.4 I add a new column required_total on table catalog_product_bundle_option

I created the extension_attributes.xmlfile

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Api/etc/extension_attributes.xsd">
    <extension_attributes for="Magento\Bundle\Api\Data\OptionInterface">
        <attribute code="required_total" type="int"/>
    </extension_attributes>
</config>

I did bin/magento setup:di:compile to generate the interface \Magento\Bundle\Api\Data\OptionExtensionInterface in var/generation folder.

In admin edit form of a bundled product Magento use $this->optionsRepository->getList() to retrieve bundle options.
Here Magento will use populateWithArray method to hydrate the collection entities.

/**
 * @param \Magento\Catalog\Api\Data\ProductInterface $product
 * @return \Magento\Bundle\Api\Data\OptionInterface[]
 */
public function getItems(\Magento\Catalog\Api\Data\ProductInterface $product)
{
    $optionCollection = $this->type->getOptionsCollection($product);
    [...]
    /** @var \Magento\Bundle\Model\Option $option */
    foreach ($optionCollection as $option) {
        [...]
        /** @var \Magento\Bundle\Api\Data\OptionInterface $optionDataObject */
        $optionDataObject = $this->optionFactory->create();

        \Zend_Debug::dump($option->debug(), 'before populate');
        $this->dataObjectHelper->populateWithArray(
            $optionDataObject,
            $option->getData(),
            '\Magento\Bundle\Api\Data\OptionInterface'
        );
        \Zend_Debug::dump($optionDataObject->debug(), 'after populate');
        die;

        $optionDataObject->setOptionId($option->getOptionId())
            ->setTitle($option->getTitle() === null ? $option->getDefaultTitle() : $option->getTitle())
            ->setDefaultTitle($option->getDefaultTitle())
            ->setSku($product->getSku())
            ->setProductLinks($productLinks);
        $optionList[] = $optionDataObject;
    }
    return $optionList;
}

Here is the debug

before populate array(10) {
  ["option_id"] => string(2) "17"
  ["parent_id"] => string(3) "719"
  ["required"] => string(1) "1"
  ["position"] => string(1) "1"
  ["type"] => string(8) "checkbox"
  ["required_total"] => string(1) "2"
  ["default_title"] => string(16) "Foo"
  ["title"] => string(16) "Foo"
}

after populate array(5) {
  ["option_id"] => string(2) "17"
  ["required"] => string(1) "1"
  ["position"] => string(1) "1"
  ["type"] => string(8) "checkbox"
  ["title"] => string(16) "Foo"
}

As you can see my new column is not set, as far as I understand looking at \Magento\Framework\Api\DataObjectHelper::_setDataValues it is because :

setter does not exist in \Magento\Bundle\Api\Data\OptionInterface
attribute is not a custom attribute

Because of that I can not retrieve my attribute value and so can not edit it in the admin edit form.

Of course $option->getExtensionAttributes() is empty.

What are my solutions here :

using a plugin to make $optionDataObject->setRequiredTotal($option->getRequiredTotal()) at the end of the function ?
Am I using the extension attributes the wrong way ?
Am I missing something ?


texts: Show different number of products in category page

texts:
I am trying to show different number of products in category but it is only working on page 1. I want to show 22 products on page1 and rest all the pages 20 products per page. I managed to change by setPageSize in first page and it is working well, but rest all the pages I am unable to get products limit to 20 per page.

Page 1...22 products //works well
Page 2...20 products //doesn't work..shows from 21 to 40
Page 3...20 products //doesn't work..shows from 41 to 60

Here is how I am doing:

$currentPage = (int) Mage::app()->getRequest()->getParam('p');
if ($currentPage==0 || $currentPage==1){
    $productCollection->clear();
    $productCollection->setCurPage($currentPage)->setPageSize(22); //works..
} else {
        $productCollection->clear();
        $productCollection->getSelect()->limit(20,22); //doesn't work
}

Any idea how can I solve this?

Thanks.


texts: Redirect Admin server homepage to admin login page by default

texts:
I have separated our magento setup into load balanced frontend servers and a single admin backend server. I have specified : web/url/redirect_to_base = 0
and have setup the custom admin url in database.

The access to magento admin panel works fine at http://admin.magento.com/customadminpath but the homepage url http://admin.magento.com/ now shows the webstore frontend which is not what I wanted.

How can I redirect any requests for homepage on admin server to the admin url with admin path?

I have tried putting rewrites in nginx but couldn't get it to work. What I'm trying to setup here is any requests to admin.magento.com should be redirected to admin.magento.com/customadminpath so that no one can access the frontend pages on admin.magento.com.

Also, what's the correct approach for this, through nginx configuration or change in the index script?


texts:
say i want to change my language of gift options to gift message.
i have a translate.csv file in my package/theme/locale/
it doesnt overwrite it.
so i found the language file in app/locale/Mage_giftmessage.csv

but isnt this a core file? I just need some clarification.
some translations work from my translate.csv and some dont. why is that?
will a change to the app/locale/* files get overwritten on an update or are they also override files? if they do get overwritten how do i override these files properly?
thanks!


texts: magento 2 : How to use observable.publishOn or observable.subscribeTo with ko js

texts:
I am getting following error while use publishOn and subscribeTo method of knockoutjs

  TypeError: ko.observable(...).publishOn is not a function

Here is the script

jsfile1.js

define([
'jquery',
'ko'
], function ($, ko) {
  return component.extend({
      this.id = ko.observable().publishOn('test');
  },
  defaults: {
      template: 'Custom_Test/product/view/test1',
  },

  )
})

jsfile2.js

define([
'jquery',
'ko'
], function ($, ko) {
  return component.extend({
      this.aid = ko.observable().SubscribeTo('test');
  },
  defaults: {
      template: 'Custom_Test/product/view/test2',
  },

  )
})

Please help me to sort it out.

Thanks in advance


texts: What are the steps required for configuring Jenkins for my Magento project in AWS?

texts: I am trying to configure Jenkins for my Magento project running in AWS. I have created a Git repository and I have the custom code present there. Can you please help me.