texts: magento 2 : resize image before upload on server

texts:
I want to upload images for custom module, so before upload image on media folder I want that resize image.
How can I set resize image before upload on media folder ?
Here is my code:
public function __construct(
        \Magento\Framework\App\Action\Context $context,
        \Magento\Framework\Translate\Inline\StateInterface $inlineTranslation,
        \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig,
        \Psr\Log\LoggerInterface $loggerInterface,
        \Magento\Store\Model\StoreManagerInterface $storeManager,
        Filesystem $filesystem,
        FileFactory $fileFactory,
        \Magento\MediaStorage\Model\File\UploaderFactory $uploaderFactory,
        \Magento\Framework\Image\AdapterFactory $adapterFactory,
        \Magento\Framework\Image\AdapterFactory $imageFactory,

        array $data = []

        )
    {
        $this->_inlineTranslation = $inlineTranslation;
        $this->_scopeConfig = $scopeConfig;
        $this->_logLoggerInterface = $loggerInterface;
        $this->messageManager = $context->getMessageManager();
        $this->_storeManager=$storeManager;
        $this->filesystem = $filesystem;
        $this->mediaDirectory = $filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem\DirectoryList::MEDIA);
        $this->fileFactory = $fileFactory;
        $this->uploaderFactory = $uploaderFactory;
        $this->adapterFactory = $adapterFactory;
       $this->imageFactory = $imageFactory;

        parent::__construct($context);

    }

    public function execute()
    {
         try {$files = $this->getRequest()->getFiles('image');
    //echo "<pre>";print_r($files);die();

            foreach($files as $key => $value){
            $imageAdapter = $this->adapterFactory->create();
            $imageAdapter->open($value["tmp_name"]);
            $imageAdapter->constrainOnly(TRUE);
            $imageAdapter->keepTransparency(TRUE);
            $imageAdapter->keepFrame(FALSE);
            $imageAdapter->keepAspectRatio(TRUE);
            $imageAdapter->resize(100,100);
             $mediaDirectory = $this->filesystem->getDirectoryRead(DirectoryList::MEDIA);
            $imagepathfolder= 'test/';
            $destinationPath = $mediaDirectory->getAbsolutePath($imagepathfolder);
            $imageAdapter->save($destinationPath);

}echo "<pre>";print_r($result);die();
        } catch (\Exception $e) {
        echo $e->getMessage();die();
        }

        /* $resultJson = $this->resultFactory->create(ResultFactory::TYPE_JSON);
        $resultJson->setData($printPath);
        return $resultJson; */
        }

I am getting error when I run above my code
Warning: imagejpeg(C:/wamp64/www/magento234/pub/media/test): failed to open stream: Permission denied in C:\wamp64\www\magento234\vendor\magento\framework\Image\Adapter\Gd2.php on line 208
What I want:
I have created a custom module and I have set one custom form with some fields. In this form I have set file input type in the form and other input fields, so when customer filled up form with image by file input and click on submit button ,it called JavaScript method and trigger ajax and call controller method where I put my above code.When I receive form elements' values as a post method in controller that time I want that image as resize image before upload process of that image.
Note
I DO NOT WANT TO UPLOAD THAT IMAGE IN ORIGINAL SIZE AND RESIZE THAT IMAGE AND UPLOAD ON OTHER PATH. I WANT THAT IMAGE FIRST RESIZE THEN IT SHOULD UPLOAD ON SERVER


texts: Magento 2 - How to remove "Add new MODEL" button on \Magento\Backend\Block\Widget\Grid\Container

texts: I am extending the \Magento\Backend\Block\Widget\Grid\Container with my block, and I want to remove the button for adding new instances of this model ("MODEL"). How can I do that?


texts: Attribute tag is not working in layout magento 2.2

texts:
I am facing attribute tag issues in the layout XML after upgrading to Magento-2.2. I have added the below tag in the "Layout Update XML" field of Magento cms page but it's not working. Can you please provide the supported tag for the blow

<attribute name="class" value="xyz-active"/>


texts: Magento 2 : How to get selected record from ui form fieldset listing grid in controller?

texts:
I have created one UI form with UI grid. When I get params in controller I can not get selected row of UI grid. How to do that?

Here is my UI Component layout file.

<fieldset name="other_field">
    <field name="1">
    </field>
    <field name="2">
    </field>
    <field name="3">
    </field>
</fieldset>
<fieldset name="slider_config">
        <argument name="data" xsi:type="array">
             <item name="config" xsi:type="array">
             <item name="collapsible" xsi:type="boolean">true</item>
             <item name="label" xsi:type="string" translate="true">Add Slides to Slider</item>
             <item name="sortOrder" xsi:type="number">21</item>
                    </item>
        </argument>
        <insertListing>
             <argument name="data" xsi:type="array">
                   <item name="config" xsi:type="array">
                   <item name="autoRender" xsi:type="boolean">true</item>
                   <item name="ns" xsi:type="string">vendor_module_slide_listing</item>
                   </item>
             </argument>
        </insertListing>
</fieldset>

In above code i need selected rows of insertListing in controller file.


texts:
I have added tax rule in

sales -> manage tax rules

and associate with customer tax class.

Now how can I programatically get this rules or fetch all the rules defined here ?

I tried this

$tax = Mage::getModel('tax/calculation')->getCollection();

            foreach($tax as $rr) {
                 echo $rr->getRuleName();
                 echo $rr->getRuleId();
                 echo '<br>';
            }

but getting blank


texts:
I want to change the url of the index page for magento 2 store.

I changed the Default Web URL to "custom", but when I go to site.com/custom it gives me a 404 and the index page is still site.com/cms


texts:
Site can't access img, JS and CSS files separated in pub/media folder. But pub/static files are accessible.

I have following config

<VirtualHost *:80>
   ServerName mage2.loc
   DocumentRoot /var/www/mage2
   <Directory /var/www/mage2>
       Options Indexes FollowSymLinks MultiViews
       AllowOverride All
   </Directory>
</VirtualHost>


texts:
I'm trying to set Custom Sort Order in Collection using afterSetCollection()

Following is my code
di.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <type name="Magento\Catalog\Block\Product\ProductList\Toolbar">
        <plugin name="sortby_extend_default_sort_filters" type="Package\Module\Plugin\Toolbar" sortOrder="99" />
    </type>
</config>

Following is my Toolbar.php

    public function afterSetCollection($collection, \Magento\Catalog\Block\Product\ProductList\Toolbar $result)
        {
            $collection = $result->getCollection();
            $currentOrder = $result->getCurrentOrder();
            $currentDirection = $result->getCurrentDirection();
            if ($currentOrder && $currentOrder == 'price') {
                $result->getCollection()->getSelect()->order(new \Zend_Db_Expr('new_price ' . $currentDirection));
                //Following is also not working
                $result->getCollection()->setOrder('new_price',$currentDirection);
            }
            return $result;
        }

When I try to print select query in list.phtml I get sorting only for follwoing

 `e`.`entity_id` DESC

Can anyone suggest, Why my sorting not applied?

FYI : new_price is created on the fly which working properly in aroundSetCollection() but not working for afterSetCollection()


texts: if click on "URL Rewrite Management" create error

texts:
today in my store magento if click on   "URL Rewrite Management" in backend menu create this error(this is a log)

eTrace:
#0 /home/lecolartga/www/app/code/core/Mage/Eav/Model/Entity/Attribute/Abstract.php(346): Mage::exception('Mage_Eav', 'Invalid backend...')
#1 /home/lecolartga/www/app/code/core/Mage/Eav/Model/Entity/Abstract.php(640): Mage_Eav_Model_Entity_Attribute_Abstract->getBackend()
#2 /home/lecolartga/www/app/code/core/Mage/Eav/Model/Entity/Abstract.php(1624): Mage_Eav_Model_Entity_Abstract->walkAttributes('backend/afterLo...', Array)
#3 /home/lecolartga/www/app/code/core/Mage/Eav/Model/Entity/Abstract.php(964): Mage_Eav_Model_Entity_Abstract->_afterLoad(Object(Mage_Catalog_Model_Product))
#4 /home/lecolartga/www/app/code/core/Mage/Catalog/Model/Resource/Abstract.php(698): Mage_Eav_Model_Entity_Abstract->load(Object(Mage_Catalog_Model_Product), 0, NULL)
#5 /home/lecolartga/www/app/code/core/Mage/Core/Model/Abstract.php(225): Mage_Catalog_Model_Resource_Abstract->load(Object(Mage_Catalog_Model_Product), 0, NULL)
#6 /home/lecolartga/www/app/code/core/Mage/Adminhtml/controllers/UrlrewriteController.php(56): Mage_Core_Model_Abstract->load(0)
#7 /home/lecolartga/www/app/code/core/Mage/Adminhtml/controllers/UrlrewriteController.php(68): Mage_Adminhtml_UrlrewriteController->_initRegistry()
#8 /home/lecolartga/www/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Adminhtml_UrlrewriteController->indexAction()
#9 /home/lecolartga/www/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('index')
#10 /home/lecolartga/www/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#11 /home/lecolartga/www/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#12 /home/lecolartga/www/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#13 /home/lecolartga/www/index.php(87): Mage::run('', 'store')
#14 {main}


texts: any have module that have add custom step in check out page?

texts:
any have module or code that, just add an only New step in Checkout Page,
just only one step, no any others data from, this step.

if have, pls help me for that,
any kind of help will be appreciated.

thank you.


texts: Memory Exhaust while saving order data in Observer

texts:
I add a custom attribute from my module to sales order like this:

$attribute  = array(
    'type'          => 'int',
    'backend_type'  => 'int',
    'is_user_defined' => true,
    'label'         => 'Admin Id',
    'visible'       => false,
    'required'      => false,
    'user_defined'  => false,
    'searchable'    => true,
    'filterable'    => true,
    'comparable'    => true,
    'default'       => NULL
);
$installer->addAttribute('order', 'admin_id', $attribute);
$installer->addAttribute('quote', 'admin_id', $attribute);

and then I want to set the custom attribute data after I place an order using observer like this:

etc/config.xml

<global>
    <events>
        <sales_order_save_after>
            <observers>
                <vendor_module>
                    <type>singleton</type>
                    <class>Vendor_Module_Model_Observer</class>
                    <method>orderPlace</method>
                </vendor_module>
            </observers>
        </sales_order_save_after>
    </events>
</global>

Model/Observer.php

class Vendor_Module_Model_Observer
{
   public function orderPlace($event)
   {
     $order = $event->getOrder();
     if($this->isAdmin()){
       $adminId = Mage::getSingleton('admin/session')->getUser()->getUserId();
       if($adminId){
         $orderModel = Mage::getModel('sales/order')->load($order->getId());

         $orderModel->addData(array('admin_id'=>$adminId));
         $orderModel->save();
       }
     }
     return $this;
   }

   private function isAdmin()
   {
      if(Mage::app()->getStore()->isAdmin())
      {
          return true;
      }

      if(Mage::getDesign()->getArea() == 'adminhtml')
      {
          return true;
      }

      return false;
   }
}

but I always got an error like this:

  Allowed memory size of 10485760 bytes exhausted (tried to allocate 20480 bytes) in Unknown on line 0

or this:

  Maximum execution time of 30 seconds exceeded in /var/www/vitamin/lib/Zend/Db/Adapter/Pdo/Abstract.php on line 298


texts:
We have a Magento 1.9 install on a LEMP server.

We're trying to set up different storefronts for different languanges as subfolders eg. /en /it /de etc. with the media and such symlinked.

Everything is working fine (that I can see) except all the SVGs are 404ing.  PNGs in the same folders are working correctly.  Permissions/Owners are identical.  Error logs seem to just show it as a typical 404 with the file location being correct.  I'm at a loss.  Any thoughts?


texts:
I need to add a custom search text field into the customer grid.
Would it be possible without changing the default grid template?
thanks


texts: How to import related products through programmatically in magento2?

texts: I don't know how to import related products programmatically. Can you please help me with this task?


texts:
Combined a Magento 1.9.0. database with a Magento 1.9.4.1. basic installation and get this error:

Fatal error: Call to a member function setData() on boolean in /app/code/core/Mage/Eav/Model/Config.php on line 651

Any ideas ?

Thanks in advance.


texts: Magento 2.2.5 - Widgets and Blocks are not visible on home page

texts:
I have created a custom theme with a parent theme (template monster). Now, the home page of my store no longer has the widgets and blocks that were present in the parent theme. The home page appears blank with header and footer only visible..

The rest of the pages appear fine.. What could be the reason behind this?.

What I have already tried?

I have deployed the static content after deleting the
pub/static/frontend directory.
I have also cleared my cache multiple times but still no luck..


texts: Shipping & Handling not showing in magento 2.3.2 on frontend?

texts:
Is shipping & Handling not showing in Magento 2.3.2 on the frontend and in the order placed email also?

shipping price calculated but not show on the customer dashboard my orders

PFA

Admin site showing properly


texts: data grid table title error magento 2.1x

texts:
there is error on admin title grid
products =>catalog
customer =>all customer
content =>pages
and more on the top of the list
Is any one have some idea to fix this issue..


texts: Magento-2.2.5 GIF Images uploaded for product not working in frontend

texts:
I am trying to upload .gif image in backend in magento2.2.5 for downloadable product but it is not displaying properly in frontend.

  product image save in below path: catalog/product\cache\960x720//e/z/video-to-gif_1.gif

Image is displayed but animation is not working.Also refer to Magento 2 - GIF Images , Animation is not working on frontend but not working

Screenshot of admin and frontend:
http://prntscr.com/r4k69p
http://prntscr.com/r4k6vw


texts: I'm getting 403 errors in my console for calendar.css, mixins.js, require.js. Is it permission or ownership issue?


texts: How can I create an attribute as "not configurable" from an install script?

texts:
When I create a dropdown attribute, Magento is always setting the "Use To Create Configurable Product" as Yes.

While in the install script I added in the options array to the Mage_Eav_Model_Entity_Setup::addAttribute() method:

"in_configurable" => false

This option is still not working.

Sample code to add an attribute from an install script:

$options = array(
    'type'                       => 'int',
    'label'                      => 'Color',
    'input'                      => 'select',
    'required'                   => false,
    'user_defined'               => true,
    'searchable'                 => true,
    'filterable'                 => true,
    'comparable'                 => true,
    'visible_in_advanced_search' => true,
    'is_configurable'            => false,
);
$this->addAttribute(
    Mage_Catalog_Model_Product::ENTITY,
    'size',
    $options
);

After I go into the Admin Panel and view the attribute data, the is_configurable attribute is set still set as Yes.


texts: Default Billing Address not saved when user having no address and do checkout In Magento 2

texts:
I need help to save the default shipping address as Default Billing address.

Steps to follow :

Register as a new customer
Now add product into cart
Go to Checkout and fill Shipping Address
Place an Order
Go to Customer Address Book Address is saved as Default Shipping Address only.

I need to assign this Default Shipping Address to Default Billing Address.
In Magento 1.9 if you follow above steps address will be saved as Default Billing as well as Default Shipping.


texts: Magento visitor data is not getting populated, why?

texts:
I need Magento's visitor_id to save some data against visitors come to my Magento store.
But I found in some instances $session[visitor_data] array is empty. But I can see frontend cookie is created.

Have anyone came across this situation?
How do I populate visitor id, if its not available?
If this is not possible what would be the best way to uniquely identify a visitor?


texts: Magento 404 page not found when trying to navigate to product url

texts:
When I got a product and it's simple without a parent and I call ->getProductUrl() I get a url like this:

  $_product->getProductUrl();

And this is giving me:

http://testdata.com/slim-fit-dobby-oxford-shirt.html

Meanwhile, a simple product with parent is returning a URL like this, which works:

http://testdata.com/french-cuff-cotton-twill-oxford-570.html

And If I try to access that url, I will get 404 page not found. Any help with this please?


texts: Magento 1.7.0.2 : Creating a Website fails (Redis backend cache error)

texts:
I'm having an issue, just trying to create a new website.
I'm entering the information in System / Manage stores / Create Website.

First, It fails with a fatal Error 512 Mo exhausted ...

I increased memory in php.ini to 1024M and now it fails with a message :

An error occurred while saving. Please review the error log.

In exception.log I get this :

Exception message: Error cleaning cache by mode matchingAnyTag: read error on connection
Trace: #0 ...../Cm_Cache_Backend_Redis/Cm/Cache/Backend/Redis.php(671): Zend_Cache::throwException('Error cleaning ...', Object(CredisException))

So .... I'm a bit confused, can't find anything anywhere about this issue.

I tried editing the file, checking where the problem may come from but still no clue.

Thanks for any lead.

EDIT : ok so ... Changing the read_timeout value in /app/etc/mylocalfile.xml is actually delaying the exception, so the exception does seem to come from redis reading timing out...

Question is : Why the hell is the website creation taking sooooo long ?

Retrying with a 200sec timeout (100 sec just failed)


texts: Is there any known way to create a cart item that doesn't exist as a product?

texts:
I'm going to be receiving product data from multiple 3rd-party sources in a common format.

Generally, I've seen this issue handled by either creating  a product for each incoming item in the user's cart from the 3rd-party, or loading all the relevant product data as json in a product's textbox custom option.

The first way can add a lot of bloat to the database, and the second can require updating a lot of templates to use the json data.

Is there a way to directly create quote items without a corresponding product existing? Or does anyone have a good starting point where I could override the existing functionality?

I'm poking around Mage/Checkout but not finding quite what I'm looking for.

Thanks.


texts:
I have register and login links on my website. Register is working fine but when i tried to login it again come back to the login screen with out any error message.

I have tried to re-write the htaccess for my site but still the same issue.

Any help Will Be appreciated:

Here is the link:

https://www.dauerusa.com/customer/account/login/

Thanks


texts: How to remove an automatically generated canonical link from a product page using custom layout XML?

texts:
I already have canonical links turned on in my CE 1.9 install, but if I didn't I know that I can add a canonical link to a product using custom layout XML this way:

<reference name="head">
<action method="addLinkRel">
<rel>canonical</rel>
<href>https://www.example.html</href>
</action>
</reference>

I would like, however, to customize a particular product's canonical link and I would like to use custom XML to remove the original one before I add in the next so I don't have two links. Is this possible without modifying code?


texts: How to create function in magento for setSession data and getSession data like setter and getter

texts:
I need to create function in magento for set session data and getSession data ... I created on e but this is not working ..

public function mySession($data){

        $_session = Mage::getModel('core/session');

        $_session->set($data);

        }

how can we write session function for set and gat  for custom module


texts: Custom variable access using 'var' on working on product detail page in magento 2

texts:
I am trying to access custom product attributes value in product description on product detail page using 'var' Like for e.g {{var waz_origin}}
But i am not getting its value on frontend. See https://prnt.sc/t89rbg
This is how it comes on frontend.


texts: Mixin for Magento_ConfigurableProduct/js/configurable::_reloadPrice not working

texts:
I'm trying to follow the example here

Magento 2 - Why do SKU not change dynamically in configurable product view page

to create a mixin for configurable products that will show dynamically a notification when the user selects an option that changes the price.

My task is very similar to the original post where the sku is changed but I haven't been able to make that example work or achieve what I'm trying to do.

I'm putting the relevant parts of the code here.

Vendor/Module/view/frontend/web/js/configurable-mixin.js

define([
    'jquery',
    'mage/utils/wrapper'
], function ($, wrapper) {
    'use strict';
    return function (targetModule) {

        //code here is executed
        var reloadPriceWrapper = wrapper.wrap(targetModule.prototype._reloadPrice, function (original) {

            //code in here never gets executed
            //call original method
            var result = original();

            //custom code to show a notification
            console.log('test');

            //return original value
            return result;
        });

        targetModule.prototype._reloadPrice = reloadPriceWrapper;
        return targetModule;
    };
});

requirejs-config.js

var config = {
    config: {
        mixins: {
            'Magento_ConfigurableProduct/js/configurable': {
                'Vendor_Module/js/configurable-mixin': true
            }
        }
    }
};

My mixin seems to be loaded in the page, but I don't see any part of the code inside the wrapped function execute at all and it seems targetModule.prototype._reloadPrice is undefined during the whole process which I assume is the reason it fails.

What could cause this issue?

I'm on Magento 2.3.1


texts:
I want to restrict some unwanted users to access the site. So I am redirecting them to 404 Page but my logic is going to an infinite loop as the event I am calling from controller_action_predispatch is called several times and I am not able to find the right one.

My Logic

namespace Namespace\Module\Observer;

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

    protected $_myHelper;

    public function __construct(
        \Namespace\Module\Helper\Data $myHelper,
    ) {
        $this->_myHelper = $myHelper;
    }

    public function execute(\Magento\Framework\Event\Observer $observer) {
        if(in_array($currentUser, $restrictedUsers)){
            $url = $this->_myHelper->getNoRoutePageUrl();
            header('Location: ' . $url);
            exit;
        }
    }
}

My event.xml

<?xml version="1.0" ?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
    <event name="controller_action_predispatch">
        <observer instance="Namespace\Module\Observer\RedirectIp" name="namespace_module_observer_controller_actionpredispatch_controller_action_predispatch"/>
    </event>
</config>


texts: Can't get Custom Admin Tab to work!! (Very detailed of what I have thus far)

texts:
I have Magento 1.7 and I'm trying to create a custom tab in the admin panel to change customer attributes that I have created.

First off I created:
/app/code/local/Mage/Adminhtml/Block/Customer/Edit/Tabs.php
which copies /app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tabs.php

I want to do this correct, so I'm not changing the core files!
Inside the function _beforeToHtml() I have the following code:

$this->addTab('Custom',array(
       'label' =>Mage::helper('customer')->__('Custom Info'),
       'class' =>   'ajax',
       'url'   =>   $this->getUrl('*/*/custom',array('_current'=>true)),
        ));

This code alone creates the Custom Info tab in the picture!

When I click the tab nothing happens of course so I tried adding code to fix that!

I copied: /app/code/core/Mage/Adminhtml/controllers/CustomerController.php
to /app/code/local/Mage/Adminhtml/controllers/CustomerController.php
and added the following code:

public function customAction()
    {
        $this->_initCustomer();
        $this->getResponse()->setBody(
            $this->getLayout()->createBlock('customtab/adminhtml_customer_edit_tab_custom','admin.customer.custom')->setCustomerId(Mage::registry('current_customer')->getId())
                ->setUseAjax(true)
                ->toHtml()
        );
    }

Next, I created the file:
/app/code/local/Sean/CustomTab/Block/Adminhtml/Customer/Edit/Tab/Custom.php
and that file contains:

<?php

class Sean_CustomTab_Block_Adminhtml_Customer_Edit_Tab_Custom extends Mage_Adminhtml_Block_Widget_Form
{
    public function __construct()
    {
        parent::__construct();
        $this->setTemplate('customtab/customer/tab/custom.phtml');
    }
}

Then, I created:
/app/design/adminhtml/default/default/template/customtab/customer/tab/custom.phtml
Where I just have  Hello World!

And Lastly I enable the extension through
app/etc/modules/Sean_CustomTab where I have the code:

<?xml version="1.0"?>
<config>
    <modules>
        <Sean_CustomTab>
            <active>true</active>
            <codePool>local</codePool>
        </Sean_CustomTab>
    </modules>
</config>

I Refresh the Magento Cache! but alas nothing happens when I click the Custom Info tab it just shows the loading icon then it goes back to as if I never clicked it!  Please help I'll be here responding to answers and questions to clarify is there a typo? Or something I'm missing?


texts: How to add an html attribute to configurable product with select element in Magento 2

texts:
How to add an attribute to configurable product select element in Magento 2.

Now:

<select name="super_attribute[<?= /* @escapeNotVerified */ $_attribute->getAttributeId() ?>]"
                        data-selector="super_attribute[<?= /* @escapeNotVerified */ $_attribute->getAttributeId() ?>]"
                        data-validate="{required:true}"
                        id="attribute<?= /* @escapeNotVerified */ $_attribute->getAttributeId() ?>"
                        class="super-attribute-select <?php echo $id; ?>">
                    <option value=""><?= /* @escapeNotVerified */ __('Choose an Option...') ?></option>
                </select>

What i want:

<select name="super_attribute[136]" data-selector="super_attribute[136]" data-validate="{required:true}" id="attribute136" class="super-attribute-select color" aria-required="true">
          <option  value="">Choose an Option...</option>
          <option data-class="Red" value="75">Red</option>
          <option data-class="Teal" value="61">Teal</option>
          <option data-class="Black"value="4">Black</option>
          <option data-class="Ivory" value="8">Ivory</option>
    </select>

Thanks.


texts: How can I get the review count on review's list.phtml in Magento 1.8?

texts:
How can I get the review count on review's list.phtml?

frontend\base\default\template\review/product/view/list.phtml

I get an error when I use this code in this page,

<?php
// Get the number of reviews of the product on the product page.
$storeId    = Mage::app()->getStore()->getId();

$summaryData = Mage::getModel('review/review_summary')
->setStoreId($storeId)
->load($_product->getId());

/* @var $summaryData Mage_Review_Model_Review_Summary */

/*

array(
['primary_id'] => 147
['entity_pk_value'] => 166
['entity_type'] => 1
['reviews_count'] => 1
['rating_summary'] => 80
['store_id'] => 1
)
*/
//var_dump($summaryData['reviews_count']);
?>

error,

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

While the count on frontend\base\default\template\review/product/view/count.phtml will always return  empty

<?php if (!empty($count)):?>
    <?php echo $this->__('%s Review(s)', $count) ?>
<?php endif;?>

Any idea why?

I have code in my catalog.xml's <catalog_product_view translate="label">,

            <block type="page/html_pager" name="product_review_list.toolbar">
                <action method="setLimit"><limit>2</limit></action>
            </block>
            <block type="review/product_view_list" name="product.info.product_additional_data" as="product_review" template="review/product/view/list.phtml">
                <block type="core/template" name="product_review_list.count" template="review/product/view/count.phtml" />
                <block type="review/form" name="product.review.form" as="review_form"/>
            </block>


texts: how to upload image in custom from in magento 2.4

texts:
How to upload image array in custom from in Magento 2.4

                                        <?= $block->escapeHtmlAttr(__('Upload Images (Max file size: 5mb)')) ?>
                                    <input name="files[]" id="files"
                                           value="<?= $block->escapeHtmlAttr($viewModel->getUserName()) ?>"
                                           class="input-text form-control" type="file"/>


texts:
magento 2 file get content not working
please help


texts: Changing Validation Text at change password page in magento2

texts:
I want to change or edit the validation text(Minimum length of this field must be equal or greater than 8 symbols. Leading and trailing spaces will be ignored.) at change password page also shown here in picture, may somebody please suggest which file should i touch or edit for doing this.
I tried edit a file - /var/www/html/development_m241/m241/vendor/magento/module-security/Test/Mftf/Test/NewCustomerPasswordLengthTest.xml  (at line no. 41) but not sure if it is only file i should play with or any other way to do this.
[![screenshot error][1]][1]


texts:
the Search... disappeared from inside of the Magento Frontend search box and <a href=mysite.com> shown instead!
how can i solve it?


texts: Custom module admin Edit section became empty

texts:
I created some custom module and every thing is working fine, Suddenly after uploading one more image from admin pannel in that custom module, when i refreshed my frontend page to see the effect i saw image is corrupted but some other data is coming.

When I click on edit link (in admin side) there is no data coming from database.

I checked database all data are saved there.

Can any one suggest what happened to the module.

There are some errors like

#13 /var/www/vhosts/pstest.de/homemadd.psweb.in/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#14 /var/www/vhosts/pstest.de/homemadd.psweb.in/index.php(88): Mage::run('', 'store')
#15 {main}

in log , but one can know it is thrown by my module , as there is nothing related to my module(like module name of my custom names that i used)

mysql4-install-0.1.0.php Previous Sql

mysql4-upgrade-0.1.0-0.1.1.php   Upgrade Sql

I also updated config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Maddy_Newssection>
            <version>0.1.1</version>  <!-- new version -->
        </Maddy_Newssection>
    </modules>

but in edit section nothing coming


texts:
Is it possible to override Magento 2 Luma phtml Files? I've created a new theme based on Luma which is working perfectly but I can't find any phtml files anywhere.

I've also noticed my app/code directory is completely empty.


texts:
We have a Magento extension which is compatible with Magento 1.7+. I would like to make it compatible with Magento 1.5 and later.

But installation does not work on Magento Connect Manager / downloader it gives following error on console

CONNECT ERROR : Unsupported resource type

I was able to install it manually

download extension with freegento.com
unzip package
copy Eightdigits_MarketingSuite/app to MAGENTO_HOME/app
cd MAGENTO_HOME
./mage sync   (you need to make ./mage executable if it was not : chmod 750 mage)
I have cleaned cache on Cache Management page of Magento admin dashboard
I have logged out and logged in to Magento Admin (as there is bug on Magento, after new installation it keeps giving 404 for new menu item)
I have refreshed Magento store page so I could see 8digits comments in page source

<!-- 8digits Marketing Suite -->

Instead of manual installation, we would like to make the extension compatible with 1.5 too, and possible to install with Magento Connect Manager. Could you please help with the error?

Update

when I enabled log (System -> Configuration -> Developer -> Log), I saw these on system.log

2014-07-31T20:08:58+00:00 ERR (3): Warning: fopen(): Filename cannot be empty  in /private/var/web/magento152/downloader/lib/Mage/Connect/Package/Reader.php on line 119
2014-07-31T20:08:58+00:00 ERR (3): Warning: get_resource_type() expects parameter 1 to be resource, boolean given  in /private/var/web/magento152/downloader/lib/Mage/Connect/Package/Reader.php on line 140
2014-07-31T20:08:58+00:00 ERR (3): Warning: fclose() expects parameter 1 to be resource, boolean given  in /private/var/web/magento152/downloader/lib/Mage/Connect/Package/Reader.php on line 123

ps: I get this error when I want to upload/install package file (Eightdigits_MarketingSuite-1.0.0.tgz)

I changed the method (Reader.php line 119) to

protected function _readFile()
    {
        $data = '';
        if ($this->_file) {
        $handle = fopen($this->_file, 'r');
        try {
            $data = $this->_loadResource($handle);
        } catch (Mage_Exception $e) {
            fclose($handle);
            throw $e;
        }
        fclose($handle);
        }
        return $data;
    }

When I tried upload again, now console printed out

CONNECT ERROR: Package file is invalid
Invalid package name, allowed: [a-zA-Z0-9_-] chars
Invalid version, should be like: x.x.x
Invalid stability
Invalid date, should be YYYY-DD-MM
Invalid channel URL
Empty authors section
Empty package contents section

this time system.log did not give any more logs on this issue... I assume it was not able to read package.xml file inside tgz file. I checked the package file and it has package.xml and looks like right. I have also tried package that was generated by Magento itself (using magento admin Package Extensions)

same environment if I try to install with Magento Connect, I get this error (now I cannot also install with Magento Connect, but today I installed at least on our test environment without problem)

CONNECT ERROR: Package 'Eightdigits_MarketingSuite' is invalid
Empty package contents section

Here also I do not get any error log on system.log file.

Update 2

I have created extension package from System -> Magento Connect -> Package Extensions on admin interfaces of Magento 1.9 and Magento 1.5.1 (a installation that I have integrated extension manually as described above). Both packages have resulted in same error when I try to upload to another Magento 1.5.1 installation.


texts: Magento 2 - pass string from AbstractMethod::isAvailable to method-renderer (display it at checkout)

texts:
I have custom method in my store (I used \Magento\Payment\Model\Method\AbstractMethod class). In the isAvailable method, I get a string that I would like to display to the customer at the checkout. Now, the checkout looks like this:

But I would like to be able to display additional message here, like this:

The additional string is constructed in isAvailable, so all I need is to pass it to method-renderer.js or checkout_index_index.xml (I think).

I can also construct the string in custom controller, so I was thinking of adding some JS to checkout that will hit custom controller with HTTP GET request and then add it to the source, but I hope there is a better way to do it.


texts: editing products programmatically not affects in admin

texts:
I added product programmatically and it was fine but when I tried to edit, it didn't appear in admin but when I print the product it appear with the new values.
I cant't figure why this happened.
is there is any one faced this problem before?


texts: How to Remove Customer Account Dashboard Links

texts:
I want to remove following links in the customer account dashboard left panel?

My Applications
Gift Registry
Reward Points
Gift Card Link

I'm working in the Magento 1.7 Community Edition.
Any help will be appreciated.


texts: magento : add product to shopping cart via API

texts:
i want to add product to shopping cart via API , i use this code

    //return "Add Product To Cart ... ";
    $proxy = new SoapClient('http://mymagent.com/api/v2_soap/?wsdl');

    $sessionId = $proxy->login('zazaza', '123456');

    $cartId = $proxy->shoppingCartCreate($sessionId);
    //var_dump($result);

    $result = $proxy->shoppingCartProductAdd($sessionId, $cartId,$sessionId, 10, array(array('product_id' => '166');

    //var_dump($result);
    return $result;

but it return to me

HTTP Error: socket read of headers timed out

can any body help me ? thanks


texts: Magento 1.9 - To get all simple(associated) products of grouped product regardless of websites/store views

texts:
I'm operating multiple websites(storeviews) and i want to bring all simple products on A website although it doesn't be checked to appear on  A website on product-website tab.

There would be only grouped products on A website and then click them, i want to show all of simple products associated with the grouped product even they are not a member of A website.

Literally, I'd like to implement what shows in Magento Admin Page on A website catalog page.

So, I want to modify grouped.phtml file and it needs that a product(grouped product) that this module calls have to call all of associated simple product regardless of checking this website or not. Is there a way to implement this ? Please share your opinion.

  app/design/frontend/base/default/template/catalog/product/view/type/Grouped.phtml

<?php $this->setPreconfiguredValue(); ?>
<?php $_product = $this->getProduct(); ?>
<?php $_associatedProducts = $this->getAssociatedProducts(); ?>
<?php $_hasAssociatedProducts = count($_associatedProducts) > 0; ?>
<?php if ($this->displayProductStockStatus()): ?>
<?php if ($_product->isAvailable() && $_hasAssociatedProducts): ?>

<?php echo $this->__('Availability:') ?> <?php echo $this->__('In stock') ?>

<?php else: ?>

<?php echo $this->__('Availability:') ?> <?php echo $this->__('Out of stock') ?>

<?php endif; ?>

EDIT

  /wh-clone/app/code/local/Kbethos/AllProducts/Block/Product/View/Type/Grouped.php

<?php
class Kbethos_AllProducts_Block_Product_View_Type_Grouped extends Mage_Catalog_Block_Product_Abstract
{
    /**
     * Revert getProduct functionality to parent:parent
     *
     * @see Mage_Catalog_Block_Product_Abstract
     * @return null|Mage_Catalog_Model_Product
     */
    /*
    public function getProduct()
    {
    if (!$this->hasData('product')) {
        $this->setData('product', Mage::registry('product'));
    }

    return $this->getData('product');
    }
    */

}

  app/code/local/Kbethos/AllProducts/etc/config.xml

<?xml version="1.0"?>
<config>
  <modules>
    <Kbethos_AllProducts>
      <version>0.1.0</version>
    </Kbethos_AllProducts>
  </modules>
  <global>
    <blocks>
        <allproducts>
            <class>Kbethos_AllProducts_Block</class>
        </allproducts>
    </blocks>
    <helpers>
      <allproducts>
        <class>Kbethos_AllProducts_Helper</class>
      </allproducts>
    </helpers>
  </global>
</config>

  app/design/frontend/default/modern/layout/catalog.xml

<PRODUCT_TYPE_grouped translate="label" module="catalog">
    Catalog Product View (Grouped)
    <reference name="product.info">
        <block type="kbethos/allproducts_block" name="product.info.grouped" as="product_type_data" template="catalog/product/view/type/grouped.phtml">
            <block type="core/text_list" name="product.info.grouped.extra" as="product_type_data_extra" translate="label">
                Product Extra Info
            </block>
        </block>
    </reference>
</PRODUCT_TYPE_grouped>


texts: I am looking for a way to display the MFR# and UPC# on the product page just the way it shows the SKU#. Currently the page does show the SKU. I would like to have the UPC and MFR show close to the SKU. I already have the attribute fields in the backend for products. Also not all my items have a UPC# and MFR# and when the field is empty in the backend for that product it won't show on the product page.


texts: Magento 2: Issue while add custom top links in header

texts:
I am trying to add custom top link via custom module.

File /app/code/<VendorName>/Inquiry/view/frontend/layout/default.xml

If I used <referenceBlock name="header.links"> then its working fine.

<body>
    <referenceBlock name="header.links">
        <block class="Magento\Framework\View\Element\Html\Link" name="inquiry.link" before="-">
            <arguments>
                <argument name="label" xsi:type="string" translate="false">Inquiry</argument>
                <argument name="path" xsi:type="string" translate="false">inquiry</argument>
            </arguments>
        </block>
    </referenceBlock>
</body>

But, If I used <referenceBlock name="top.links"> then it is not working.

<body>
    <referenceBlock name="top.links">
        <block class="Magento\Framework\View\Element\Html\Link" name="inquiry.link" before="-">
            <arguments>
                <argument name="label" xsi:type="string" translate="false">Inquiry</argument>
                <argument name="path" xsi:type="string" translate="false">inquiry</argument>
            </arguments>
        </block>
    </referenceBlock>
</body>

Can anyone guide me here, what is going wrong with second code? Because in Google search result everywhere peoples has suggested <referenceBlock name="top.links"> but it is not working in my custom module. As well same code is written in magento 2 core module. I stuck here..


texts: What is the difference between Interface and Abstract class Magento 2?

texts: Please explain me in details or give me any good reference link.


texts: Getting error while adding category Magento2

texts:
I am getting below error while saving category.
This error are from log file.

  [2019-01-18 12:03:51] main.CRITICAL: SQLSTATE[42S02]: Base table or view not found: 1146 Table
  'a76e6b4a_demo.amasty_xsearch_category_fulltext_cl' doesn't exist,
  query was: INSERT INTO catalog_category_entity_varchar
  (entity_id,attribute_id,store_id,value) VALUES (?, ?, ?, ?) ON
  DUPLICATE KEY UPDATE entity_id = VALUES(entity_id), attribute_id
  = VALUES(attribute_id), store_id = VALUES(store_id), value = VALUES(value) {"exception":"[object]
  (Zend_Db_Statement_Exception(code: 42): SQLSTATE[42S02]: Base table or
  view not found: 1146 Table
  'a76e6b4a_demo.amasty_xsearch_category_fulltext_cl' doesn't exist,
  query was: INSERT INTO catalog_category_entity_varchar
  (entity_id,attribute_id,store_id,value) VALUES (?, ?, ?, ?) ON
  DUPLICATE KEY UPDATE entity_id = VALUES(entity_id), attribute_id
  = VALUES(attribute_id), store_id = VALUES(store_id), value = VALUES(value) at

  /chroot/home/a76e6b4a/buildersbook.com/html/demo/vendor/magento/zendframework1/library/Zend/Db/Statement/Pdo.php:235,
  PDOException(code: 42S02): SQLSTATE[42S02]: Base table or view not
  found: 1146 Table 'a76e6b4a_demo.amasty_xsearch_category_fulltext_cl'
  doesn't exist at
  /chroot/home/a76e6b4a/buildersbook.com/html/demo/vendor/magento/zendframework1/library/Zend/Db/Statement/Pdo.php:228)"}
  []

I have installed Amasty Xsearch extension before which I already removed and have been executed below commands too.

rm -rf var/cache/ var/page_cache/ var/view_preprocessed/ pub/static/frontend/ pub/static/adminhtml/
php -dmemory_limit=8G bin/magento cache:clean
php -dmemory_limit=8G bin/magento cache:flush
php -dmemory_limit=8G bin/magento setup:upgrade
php -dmemory_limit=8G bin/magento setup:di:compile
php -dmemory_limit=8G bin/magento indexer:reset
php -dmemory_limit=8G bin/magento indexer:reindex
php -dmemory_limit=8G bin/magento setup:static-content:deploy -f

I also give below permissions to my files and folders:

find . -type f -exec chmod 644 {} \;
find . -type d -exec chmod 755 {} \;
find ./var -type d -exec chmod 777 {} \;
find ./pub/media -type d -exec chmod 777 {} \;
find ./pub/static -type d -exec chmod 777 {} \;


texts:
I want to update the class Select and its getValuesHTML() method which is saved here: module-catalog/Block/Product/View/Options/Type/Select.php

I have made a copy of this file and placed it in my theme here:
VENDOR/THEME/Magento_Catalog/Block/Product/View/Options/Type/Select.php

I've done the following, but my changes still aren't taking effect:

php bin/magento setup:static-content:deploy

php bin/magento indexer:reindex

php bin/magento cache:clean

Have I placed the file in the wrong folder location?


texts:
How to  resize the header logo of magento??
Please reply soon.. I am Working now

<img src="<?php echo $this->getLogoSrc()->resize() ?>" alt="<?php echo $this->getLogoAlt() ?>" />


texts: Magento remove 0 value attribute in Layer Navigation

texts:
How to disable attribute in layer navigation if that attribute have 0 values

i used this

<?php if($_item->getCount() > 0):?>

        <?php $inputId = $_item->getFilter()->getRequestVar().'_'.$_item->getValue() ?>
        <input type="checkbox" id="<?php echo $inputId ?>" name="<?php echo $_item->getFilter()->getRequestVar(); ?>" value="<?php echo $this->urlEscape($_item->getUrl(true)) ?>" <?php if ($_item->isSelected()):?>checked="checked"<?php endif ?> />
        <label for="<?php echo $inputId ?>"><?php echo $_item->getLabel() ?>
            <?php if ($this->shouldDisplayProductCount()): ?>
            (<?php echo $_item->getCount() ?>)
            <?php endif ?>

    <?php endif;?>

it disable Values but Lable How to disable this Label


texts: Magento 2 Add Anchor link in Notice, Error or Success Message

texts:
The link shows exactly how it is typed instead of an actual link. What am I missing?

        <?= $block->escapeHtml($block->getNoResultText() ? $block->getNoResultText() : __('Your search returned no results. Use our Part Finder or Contact page if you cannot find what your looking for as we may have it or can order it in.')) ?>
        <?= /* @noEscape */ $block->getAdditionalHtml() ?>
        <?php if ($messages = $block->getNoteMessages()) : ?>
            <?php foreach ($messages as $message) : ?>

<?= /* @noEscape */ $message ?>
            <?php endforeach; ?>
        <?php endif; ?>


texts: Magento RWD Theme: How to move related products to a new tab?

texts:
I am fairly new to developing in Magento, and currently on a local server developing a custom theme. Now, what I want is to move the related products from it's current default location, to residing in a seperate tab. From research I believe that a local.xml is required, and have made one. What code do I need to place within here ?

This image depicts it's current location and I want it to be residing within a new tab say next the reviews tab.


texts: Add multiple items with one click to cart

texts:
Hi i am working on site where i can add products to cart using query like this :

window.location.href = '<?php echo Mage::getBaseUrl(); ?>checkout/cart/add?product=<?php echo $current_product_id; ?>&qty='+ qty + '&super_attribute[139]='+ size +'&super_attribute[141]='+ color+'';

Now i am trying to submit multiple item to cart with single query (only options to add to cart) .I try above method by sending static parameters but it only adds one product.As there any alternative for this ? thanks in advance.
I saw this method but this uses options with product ids.I have only option/parameters


texts: One Page Checkout Issue - Billing is not defined - onepage:1772

texts:
I have a problem with my one page checkout in my Magento 1.7.0.2 store.  The store is not yet launched so all products are demo, but I can't seem to solve this issue.  At page load I get

  ReferenceError: billing is not defined @ line 1772

It's inline javascript.  Here is the troublesome code below:

billing.onSave = function(evt){
    new Ajax.Updater('onepage-checkout-shipping-method-additional-load', 'http://purchaseblack.com/checkout/onepage/getAdditional/', {onSuccess: function() {
          this.nextStep(evt);
    }.bind(this), evalScripts:true});
}.bindAsEventListener(billing);

}

When I then use this page, nothing else related to finishing the checkout process works, and I get more, new errors.  My question is this:

How do I define billing?  What file(s) do I need to edit to ensure that billing is defined properly and permanently?

Hopefully, this is the root of the other errors, and I can move on to the next set of issues.

This is my first post and I am pretty new, so bear with me here. If there is any info I can provide to help you help me, let me know.


texts: how to check if product is already in cart

texts:
I am creating certain group of products which has one quantity for each product. So, I want to disable the Add to Cart button if that same product is in cart and change the text of the button to Already in Cart.
How can I achieve this??
I am using magento 2.2

Any help/suggestion is appreciated.
Thank you.


texts: Consumer is not authorized to access %resources Magento_Sales::sales

texts:
I have this basic API script:

<?php
    ini_set('display_errors', 1);
    ini_set('display_startup_errors', 1);
    error_reporting(-1);

    $usr = [
        'username' => 'username',
        'password' => 'somePassword'
    ];

    $ch = curl_init('https://magentostore/index.php/rest/V1/integration/admin/token');

    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
    curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($usr));
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json', 'Content-Length: '. strlen(json_encode($usr))]);

    $token = curl_exec($ch);

    echo '
';
    print_r($token);
    echo '
';

    echo '========================';

    $ch = curl_init('https://magentostore/index.php/rest/V1/orders/1');

    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json', 'Authorization: Bearer '. json_decode($token)]);

    $result = curl_exec($ch);

    $result = json_decode($result, 1);
    echo '
'. print_r($result) .'
';

but it returns this message:

  Array ( [message] => Consumer is not authorized to access %resources [parameters] => Array ( [resources] => Magento_Sales::sales ) )

I'm not sure why, my script should work but I can't figure out why? Is it because of username account permissions? Shouldn't be as user = admin. Just trying to get array of orders ...

Alternative testing method that yielded same results:

I did:

curl -X POST 'https://magentostore/index.php/rest/V1/integration/admin/token' \
-H 'Content-Type:application/xml' \
-d '<login><username>admin</username><password>password</password></login>'

which got me the Token, which I then used like this:

curl -X GET https://magentostore/index.php/rest/V1/orders/1' -H 'Authorization: Bearer <Token that was returned>'

which gets me the same error as above

Edit:

I've tried with a few different API Endpoints and some work (like getting categories) but /orders still doesn't. I've tried on 3 separate environments and only 1 works:

Env One - Doesn't Work

OS: CentOS 7
PHP Version: 7.1
Magento Version: 2.2.5
Hosted outside of LAN

Env Two - Doesn't Work

OS: CentOS 7
PHP Version: 7.0
Magento Version: 2.2.5
Hosted outside of LAN

Env Three - DOES WORK

OS: Linux Mint 19
PHP Version: 7.2
Magento Version: 2.3-develop
localhost


texts:
What is the preferred method of beginning a full site build, from scratch?  My builds typically begin from fully mocked-up HTML5 wireframe pages, and we plug in functionality from there.

But, part of me feels that most of the time in the late stages of a project we wind up finding all of the areas of functionality that need to be plugged in - typically things like Enterprise RMA, Customer My Account section, etc. I think this could be avoided by starting with a Magento theme from day 1; the opposing view says that there will be equal amount of time writing CSS and modifying structure from the default.

Do you build on the Core "blank" theme? Is there an Enterprise version of this blank theme? What is the best-practice here?


texts: How can I know if the customer that made the order is guest or registered customer?

texts:
The problem is that I am sending the Magento order to an external ERP and they need the customer id from Magento.

the problem comes when the customer is guest because in theory this customer doesn't have an id but I am not sure. Is there a way to check if the customer is a guest?

I am using the Mage_Sales_Model_Order object in order to get the information I need from the customer.

Thanks!


texts:
I want to be able to display how long the user has been signed up in their account dashboard.

<?php
  $customer = Mage::getSingleton('customer/session')->getCustomer();
  $signUpDate = $customer['created_at'];
  $signUpYear = date('Y', strtotime($signUpDate));
?>

This works but it feels kind of hacky... Is there a more idiomatic way to find the year a user signed up in?

I'm working in theme_name/default/template/customer/account/dashboard/hello.phtml


texts: filtering product collection does not work with command

texts:
I face a problem with a collection. I have fresh products that need to be taken out from store 3 days before the expiration date. I created a command that is called by a cron. I've constructed it like that :

public function __construct(
CategoryCollection $categoryCollection, CategoryCollection $productCollection, Category $category, HelperData $helper, Utf8force $utf8helper, State $appState, ObjectManagerFactory $objectManagerFactory, \Magento\Framework\App\ResourceConnection $resource, $name = null
) {
    $this->_categoryCollection = $categoryCollection;
    $this->_productCollection = $productCollection;
    $this->_categoryModel = $category;
    $this->_moduleHelper = $helper;
    $this->_utf8helper = $utf8helper;
    $this->_state = $appState;
    $this->_resource = $resource;
    $params = $_SERVER;
    $params[StoreManager::PARAM_RUN_CODE] = 'admin';
    $params[StoreManager::PARAM_RUN_TYPE] = 'store';
    $this->objectManager = $objectManagerFactory->create($params);
    parent::__construct($name);
}

This class contains other function that are working but are not relevant for this question (import new products and categories).

The function is called in the execute. We did not set if we will deactivate or delete the product so yet it is called deactivate even if I call delete function.

private function _deactivateOldProducts() {
    $today = new \DateTime();
    $dlc = new \DateTime();
    $dlc->add(new \DateInterval('P3D'));
    $this->_productCollection->addAttributeToFilter('date_limite',
            array(
                'from' => $today->format('Y-m-d H:i:s'),
                'to' => $dlc->format('Y-m-d H:i:s'),
                'date' => true
            )
        );
    foreach ($this->_productCollection as $product) {
        $product->delete();
    }
    die();
}

I tried both things and they do not work. Whatever attribute I try, I get the exception : Invalid attribute name: *****

Thank you for any help.


texts: How add category programmatically magento 2

texts:
How create a category programatically. With the attributes name, url key, image, path, parent id, is active, description.

And

How to insert data for a new attribute added by InstallDate a category. Ejm.: new attribute -> code


texts: Magento 2.0 does getOrderPlaceRedirectUrl work?

texts:
I am trying to convert an existing custom third party payment module for Magento 1.x to Magento 2.0.

However, when comes to redirecting the user to the third party payment gateway, the getOrderPlaceRedirectUrl in my Model\SomeName.php doesn't seems like working. Some suggested that replacing some codes in the /view/frontend/web/js/view/payment/method-renderer/SomeName-method.js for the redirect function.

Would like to clarify is it true that getOrderPlaceRedirectUrl doesn't work in Magento 2.0. Many thanks.


texts: Magento 2.2.2 Admin panel grids pushed to right

texts:
At some point during developing my Magento 2 website, I flushed my cache and after a refresh, all the content on the admin panels are pushed to the right. I was working on a custom mass action under the orders tab, so I undid all my actions to the point before flushing the cache, but nothing seems to help.
See following screen:


texts: Get Server Path of an Image by Product ID - Magento 1.8

texts:
I have a CI project and a Magento Project on same server.

I want to periodically import Magento products into my CI website.

Everything is working perfectly, I am currently able to import each thing from Magento to my CI website.

BUT, how do I get physical/server paths of images of magento product? I want to copy those image files to my CI project.

Here is relative line I am loading product with

$product = $simpleProduct->getData()

And this is Image related part of what I get in return. look at file key, its not actual server path.

 "media_gallery":{
     "images":[
        {
           "value_id":"6",
           "file":"\/2\/-\/2-2.jpg",
           "label":"",
           "position":"1",
           "disabled":"0",
           "label_default":null,
           "position_default":"1",
           "disabled_default":"0"
        },
        {
           "value_id":"5",
           "file":"\/2\/_\/2.jpg",
           "label":"",
           "position":"2",
           "disabled":"0",
           "label_default":null,
           "position_default":"2",
           "disabled_default":"0"
        }
     ],
     "values":[

     ]
  },

PS
I dont want browser path of an image like this http://www.website/media/catalog/product/cache/1/image/9df78eab33525d08d6e5fb8d27136e95/2/-/image_name_here.jpg

I want server path.


texts:
Is there a quick way i can use the Buy X Get Y free but with the following rules?

Buy >= $100, automatically add a specific FOC item (preconfigured) for free

Been tinkering with the cart rules but i couldn't achieve the result that i wanted to.


texts: Invert "Billing address same as shipping" checkbox action

texts: I can't figure out how to invert "billing address same as shipping" checkbox in Magento checkout. What I need is just unchecked checkbox for same address and checked for different address. I override template/billing-address.html and js/view/billing-address.js and tried to switch appropriate options but can't find way to achieve my goal.


texts: Magento 1.9.2.0: table "sales_flat_order_grid" contains extra space in customer's name value

texts: In admin panel, when I want to search the orders based on customers name, I have to add 2 spaces between the first name and last name. When I looked at the value in Inspect element window, I noticed the value is displayed with an extra space. How I can fix this?


texts: Override Helper in Magento2 - Vendor\Module\Helper\Data doesn't extends Magento\Framework\App\Helper\AbstractHelper

texts:
May be i'm missing something really small.

Here is a class Class1

namespace Vendor\Module\Helper;
class Class1 extends AbstractHelper
{
    /** @var Client */
    private $client;

    /** @var ConfigHelper */
    private $config;

    public function __construct(
        Context $context,
    ){
        parent::__construct($context);

        $this->config = $configHelper;
        //stuff are here
    }

Here is Class2 which i want to override

namespace Vendor\Module\Helper;
use Vendor\Module\Helper\Class1;

class Data
{

    private $class1Helper;
    private $pageHelper;
    private $productHelper;
    private $storeManager;

    public function __construct(
        Class1 $class1Helper,
        ConfigHelper $configHelper,
        PageHelper $pageHelper,
        StoreManagerInterface $storeManager
    ) {

        $this->class1Helper = $class1Helper ;
        $this->configHelper = $configHelper;
        $this->pageHelper = $pageHelper;
        $this->storeManager = $storeManager;
    }

Now Here is my class. Added preference in di.xml

<preference for="Vendor\Module\Helper\Data" type="Vendornew\Module\Helper\Data"/>

namespace Vendornew\Module\Helper;

class Data extends \Vendor\Module\Helper\Data;
{
    public function __construct(
        Class1 $class1Helper,
        ConfigHelper $configHelper,
        PageHelper $pageHelper,
        StoreManagerInterface $storeManager
    ) {

        $this->class1Helper = $class1Helper ;
        parent::__construct(
            $class1Helper,
            $configHelper,
            $pageHelper,
            $storeManager
        );
    }

    public function getSomething()
    {
        return 'something';
    }
}

Any idea why it gives Vendor\Module\Helper\Data doesn't extends Magento\Framework\App\Helper\AbstractHelper


texts: Only Magento bundle product is not showing option in Backend (Only Bundle Product) -magento 1.9.1.0

texts:
In Admin product detail, other products are showing properly. Only Bundle products are missing product information.

I am not getting any error in console.


texts: if statement attribute condition & categories condition (2 conditions)

texts:
I have a large amount of products, about half do not have a proper description. To address this I've created an if statement that will display the product name one way and if the condition is not met then it will display it another.

Example:

<?php if ($_product->getproduct_updated()) : ?>
<?php echo $_helper->productAttribute($_product, $_product->getName(), 'name') ?><?php echo $this->__(' ') ?>(<?php echo $_product->getData('mpn')?>)
<?php else: ?>
<?php echo $_helper->productAttribute($_product, $_product->getName(), 'name') ?>
<?php else: ?>

Now, I'd like to go a step further with the above rule and set it so that if the product_updated attribute is yes AND is in certain categories, then display:

<?php echo $_helper->productAttribute($_product, $_product->getName(), 'name') ?><?php echo $this->__(' ') ?>(<?php echo $_product->getData('mpn')?>)<?php echo $this->__(' ') ?><?php echo $_helper->productAttribute($_product, nl2br($_product->getShortDescription()), 'short_description') ?>

I've done some searching and found some code and have tried for over an hour to get it to work:

<?php $categoryIds = $_product->getCategoryIds();?>
        <?php if ($_product->getproduct_updated()) && (count(array_intersect($categoryIds, array(2,71,101)))): ?>

How can I use 2 conditions in an if statement condition 1: yes/no condition 2: in categories 2,71,101 ?


texts: Cant get categories on a loop of products from orders

texts:
im trying to gett all products and also show the categories of each products from complete orders, but is giving me a strange error:

  Fatal error:  Call to a member function getId() on boolean in /home/site/public_html/csv/getAllOrders.php on line 28

Everything looks ok, i have no idea what is wrong, i already tried to get the categories by loading product id, or sku, but same error, cant figure out what is wrong.
Here is my code:

$orders = Mage::getModel('sales/order')->getCollection()
    ->addAttributeToSelect('*')
    ->addAttributeToFilter('status', array('eq' => Mage_Sales_Model_Order::STATE_COMPLETE));

    foreach ($orders as  $order) {

        foreach ($order->getAllItems() as $item) {

            echo $item->getName() ." - ";
            echo $item->getSku();

            $product = Mage::getModel('catalog/product')->loadByAttribute('sku',$item->getSku());

            if($product->getId()){
                echo implode(",", $product->getCategoryIds());
            }
            echo "
";
        }
        echo "
*********************
";

    }


texts: How to change the base link url in magento

texts:
have changed the Base Link Url(base link url) ( not the base url) . Now my site is not accessible except for the home page. How to solve this ? . This option is not visible in core_config_data table too.

I am using magento 1.9

I changed it

system -> web -> unsecured -> base link url .

Now I am not able to access anything in my site. as am getting two index.php in the url.


texts: How can i include JS script to .html page in module / Or any other way to add script.js in module template?

texts:
I am new to magento 2 and i am integrating some payment gateway in JS.

I need to add  script.js in default.html which is at this path location.

  magento2\app\code\vendor\module_name\view\frontend\web\template\payment\default.html

Location of JS script file is at this path.

  magento2\app\code\vendor\module_name\js\script.js


texts: Magento 2 View cart from abandoned cart email auto redirect to cart after login

texts:
I want to redirect customers to cart page once they login to the site from the abandoned cart email.

There is a way to set redirect after login is successful but i want redirect to happen only when cart page is accessed from abandoned cart email.

I was thinking to use variable in url that is sent over email but how to achieve that, since on success that variable gets removed from url.

Any help is appreciated,

Thanks.


texts: How to send a customer comment with shipping method in magento checkout?

texts:
I need to send a customer comment, with selected magento shipping method. How can I do that.

I made a module to override available.phtml file, where shipping methods are listed out. I can put a textbox there too. But how can I took its value along with the shipping description? Where should I make changes.

Any help will be appreciated. I am a newbie to Magento.


texts: Create a custom template just for one category

texts:
I want to change the template just for one category.
My first template referece which is work for list_rent.phtml is the following one:

  <referenceBlock name='category.products.list'>
      <action method='setTemplate'>
          <argument name='template' xsi:type='string'>Magento_Catalog::product/list_rent.phtml</argument>
     </action>
  </referenceBlock>

but when I try to set the template for details_rent.phtml it doesn't work, even I use the same syntax and details_rent.phtml is located in product/view and list_rent in product

  <referenceBlock name='product.info.details'>
      <action method='setTemplate'>
          <argument name='template' xsi:type='string'>Magento_Catalog::product/view/details_rent.phtml</argument>
      </action>
  </referenceBlock>

Can anyone give me a suggestion?


texts:
I am trying to create products using Magento V2 SOAP(WSI) from a Java web service client. Product seems to be created so as the stock data. However, the created produce doesn't link up with the Main Web Site Store, and the relevant category. Also I have filled up some additional attributes but those too seems to be not updated. I was wondering whether there is any problem with configurations. Magento version is 1.5.1.0 and the site has be configured with the sample data.

Thanks in advance for your help to identify the issue.

Here is the sample request

<?xml version="1.0" encoding="UTF-8"?>
<urn:catalogProductCreateRequestParam xmlns:urn="urn:Magento">
    <sessionId/>
    <type>simple</type>
    <set>38</set>
    <sku>phone207_sku</sku>
    <productData>
        <name>Phone 207</name>
        <description>Phone Description</description>
        <short_description>Phone Short Description</short_description>
        <weight>10</weight>
        <status>1</status>
        <visibility>4</visibility>
        <category_ids>
            <complexObjectArray>8</complexObjectArray>
        </category_ids>
        <website_ids>
            <complexObjectArray>1</complexObjectArray>
        </website_ids>
        <price>100</price>
        <tax_class_id>1</tax_class_id>
        <additional_attributes>
            <complexObjectArray>
                <key>model</key>
                <value>n2011</value>
            </complexObjectArray>
            <complexObjectArray>
                <key>in_depth</key>
                <value>Description In Depth</value>
            </complexObjectArray>
        </additional_attributes>
        <stock_data>
            <qty>10</qty>
            <is_in_stock>1</is_in_stock>
            <manage_stock>1</manage_stock>
        </stock_data>
    </productData>
</urn:catalogProductCreateRequestParam>


texts: Success and Error messages showing on different page

texts:
Some of my forms submit via AJAX and reload the page on complete. I have the $this->_initLayoutMessages(‘core/session’); line in my controller when the page loads, but the success/error messages never appear on my form page. They appear throughout the rest of the site – the home page, customer account pages, etc. Any ideas on what I’m missing that might allow them to appear on the page itself? I have a call to global messages in the template of the page that I am using as well...

Page is located at /marketplacepolicies/marketplaceaccount/editpolicies/

Here is the controller for the page:

    public function editpoliciesAction(){
$this->loadLayout( array('default','marketplacepolicies_marketplaceaccount_editpolicies'));
            $this->_initLayoutMessages('customer/session');
            $this->_initLayoutMessages('catalog/session');
            $this->getLayout()->getBlock('head')->setTitle( Mage::helper('marketplace')->__('Seller Policies'));
            $this->renderLayout();
    }

and the form submit action:

public function saveAction(){

            $wholedata=$this->getRequest()->getParams();

            if(!(empty($wholedata['info']))){
            $data = json_decode($wholedata['info'], true);

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

            foreach($data as $set){
                if (is_null($set[0])){
                    $policies=Mage::getModel('zerobars_marketplacepolicies/marketplacepolicies');
                    $policies->setData('policy_title', $set[1]);
                    $policies->setData('policy_details', $set[2]);
                    $policies->setData('partner_id', $partnerid);
                    $policies->save();
                }
                else {
                    $collection=Mage::getModel('zerobars_marketplacepolicies/marketplacepolicies')->getCollection()
                            ->addFieldToFilter('policy_id',array('eq'=>$set[0]))
                            ->addFieldToFilter('partner_id',array('eq'=>$partnerid));
                    if(count($collection)>0){
                        foreach($collection as $c){
                            $c->setData('policy_title', $set[1]);
                            $c->setData('policy_details', $set[2]);
                            $c->save();
                        }
                    }
                }
            }

        $this->_getSession()
                ->addSuccess('Your new policies have been saved.');
        $this->_redirectUrl('marketplacepolicies/marketplaceaccount/editpolicies', array('_secure' => true));

        }
    }

In response to alex_b - here is what is in my _getsession after I delete a policy:

Mage_Customer_Model_Session Object ( [_customer:protected] => [_isCustomerIdChecked:protected] => 1 [_persistentCustomerGroupId:protected] => [_skipSessionIdFlag:protected] => [_data:protected] => Array ( [_session_validator_data] => Array ( [remote_addr] =>  [http_via] => [http_x_forwarded_for] => [http_user_agent] => Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.111 Safari/537.36 ) [session_hosts] => Array ( [dev.zero-bars.com] => 1 ) [messages] => Mage_Core_Model_Message_Collection Object ( [_messages:protected] => Array ( ) [_lastAddedMessage:protected] => Mage_Core_Model_Message_Success Object ( [_type:protected] => success [_code:protected] => The policy has been deleted. [_class:protected] => [_method:protected] => [_identifier:protected] => [_isSticky:protected] => ) ) [customer_id] => [customer_group_id] => [id] => 6 [wishlist_display_type] => 0 [display_out_of_stock_products] => 1 [wishlist_item_count] => 0 ) [_hasDataChanges:protected] => 1 [_origData:protected] => [_idFieldName:protected] => [_isDeleted:protected] => [_oldFieldsMap:protected] => Array ( ) [_syncFieldsMap:protected] => Array ( ) )


texts: Create custom payment gateway in Magento 2?

texts: Which class we need to extends,implement interface and method use when create a custom payment gateway.


texts: magento after migration 404 without index.php and theme setting blank

texts:
After migrating magento, site is full of 404 errors.
Found that, if i can manually put index.php before every url - hurrey no errors

Able to login to admin with same index.php trick, and now i want to disable index.php so that all urls on site should work.

Going to system>configuration>Web>SEO>Use Web Server Rewrites = yes already.
and it dosent work.

In Addition Theme setting page is also blank.
tried modifying .htaceess with RewriteBase /magento to / but no luck.

[P.S. 404 are default server styled error and not custom magento error]
I suspect there must be some problem with web server settings, but i'm not sure
I want to fix these error, and looking for some reference or help
Thank You.


texts: mage taking dobule time when theme is changed

texts:
i have changed theme after that when i debug using profiler ,my new website takes double time i tried to debug using profiler and found issue was with mage as it took double time when theme is just changed rest all backend and all is same .

is there way to further inspect why mage is taking double time

for old theme

Memory usage: real: 51642368, emalloc: 50489664

Code Profiler   Time    Cnt Emalloc RealMem
mage    2.4455  1   0   0

and for new theme

Memory usage: real: 51642368, emalloc: 50489664
Code Profiler   Time    Cnt Emalloc RealMem
mage    5.9360  1   0   0

Memory usage and emalloc remains same in both .

Need help in way to further debug issue


texts: How to search for value then delete that line in csv file

texts:
I don't know if it should be here but, I'm using this
$filepath = 'export/subscriberslist.csv';
        $this->directory->create('export');
        $stream = $this->directory->openFile($filepath, 'w+');
        $stream->lock();

        $header = ['Id', 'Email', 'Grupo'];
        $stream->writeCsv($header);

And with variables with a foreach writing newsletter subscribers emails and group, but some of them don't have an email, so I wanted, in the end of the write, to search for the lines that has no email then delete that lines so they don't pollute the csv with lines with no info at all.
How can I do this?
Thanks for your time, Rui Silva


texts: check if the inserted data is already present in database

texts:
Last time I got help from this site how to save data in database. This is my form.

<form role="form" action="<?php echo $this->getUrl('test/user_view/save'); ?>" method="post">

  Test_Id
  <input id="test_id" type="text" name="test_id" />

  Title
  <input id="title" type="text" name="title" />

  File Name
  <input id="file_name" type="text" name="filename" />

  Content
  <input id="content" type="text" name="content" />

  Status
  <input id="status" type="text" name="status" />

  <input id="add_button" type="submit" value="Add" />

</form>

and the given below code is in controller for save operation:

public function SaveAction() {
   $postdata = $this->getRequest()->getPost();
   if($postdata)
   {
       $model = Mage::getModel("test/test");
       $model->setData($postdata);
       $model->setCreatedTime(strtotime('now'));
       $model->save();
       $this->_redirect('test/user_view/history');
   }
}

With the help of this code my data gets saved and new row gets created. However now what I want is if user enters the same id and save data it must overwrite the row, and if not then a new row gets added at the bottom with test_id auto incremented. I took test_id auto increment in database. Please help. Thanks.


texts:
I am using createEmptyCart mutation for create customer Quote Id or Mast Id.

createEmptyCart mutation write in vendor/magento/module-quote-graph-ql/etc/schema.graphqls file and use resolver file Magento\QuoteGraphQl\Model\Resolver\CreateEmptyCart. But in this Resolver file $customerId = $context->getUserId(); getting blank customer id, I have not idea how to set user id or customer id in ContextInterface, We need to set in GraphQA query or API header.

Please let me know if anyone have idea.


texts: Magento Search Products from current store only in multi store website

texts: I am working on magento one website multiple store, my problem is how to fetch only current store products by search. Because at present after search i get all products which are presne in all stores.


texts: Magento 2 -Problem with Braintree Method

texts: I have a problem with magento 2.2, I have enabled the payment method braintree but this is the result, I can not enter the card data, the form is corrupt, how can I do?


texts:
I want to change login page file (some design additional) but I didn't find the file (I think it's login.phtml file, right?) from anywhere!

I changed login.phtml file in base and my custom theme's persistent and customer directories, but nothing happened. How can I find which login.phtml file is correct?


texts: Images on category view are stretched, cannot work out how to fix

texts:
I have read several posts online how to fix this but they seem to be out dated, the code they are telling me to edit looks different on mine, the post was from 2008.

See image 1. The madeira herring image is stretched.
Image 2 displays how it should really look.

How can I fix this?!


texts: What goes in the global di.xml and what goes into the area specific di.xml?

texts:
I'm creating a Magento 2 module that adds some functionality to the backend. It does not touch the frontend at all.
But if I place some virtual type in the etc/adminhtml/di.xml (the admin di file) file I get an error that the class is not found.
If I add the same think in etc/di.xml (the global di file) everything works properly.
Other things like form modifiers work properly when added to the adminhtml di file.
From what I understood, the etc/di.xml file and etc/adminhtml/di.xml file should both be loaded on the backend pages.
Apparently this does not always work.

Here is the markup that doesn't work in the adminhtml di file.

<virtualType name="UmcConfigClassConfigSchemaLocator" type="Umc\Base\Model\Config\SchemaLocator\SchemaLocator">
    <arguments>
        <argument name="fileSchema" xsi:type="string">class</argument>
        <argument name="mergedSchema" xsi:type="string">class</argument>
    </arguments>
</virtualType>
<virtualType name="UmcConfigClassConfigMapperFactory" type="Umc\Base\Model\Config\Mapper\Factory">
    <arguments>
        <argument name="typeMap" xsi:type="array" />
    </arguments>
</virtualType>
<virtualType name="UmcConfigClassConfigConverter" type="Umc\Base\Model\Config\Converter\Converter">
    <arguments>
        <argument name="mapperFactory" xsi:type="object">UmcConfigClassConfigMapperFactory</argument>
        <argument name="mapperList" xsi:type="array" />
        <argument name="idNodes" xsi:type="array">
            <item name="0" xsi:type="string">class</item>
        </argument>
    </arguments>
</virtualType>
<virtualType name="UmcConfigClassConfigReader" type="Magento\Framework\Config\Reader\Filesystem">
    <arguments>
        <argument name="schemaLocator" xsi:type="object">UmcConfigClassConfigSchemaLocator</argument>
        <argument name="converter" xsi:type="object">UmcConfigClassConfigConverter</argument>
        <argument name="fileName" xsi:type="string">class.xml</argument>
        <argument name="idAttributes" xsi:type="array">
            <item name="/classes/class" xsi:type="string">id</item>
        </argument>
        <argument name="defaultScope" xsi:type="string">umc</argument>
    </arguments>
</virtualType>
<type name="Umc\Base\Model\Config\ClassConfig">
    <arguments>
        <argument name="reader" xsi:type="object">UmcConfigClassConfigReader</argument>
    </arguments>
</type>

Again, all the classes I have are used only in the backend.
I get this error:

  RuntimeException: Source class "\UmcConfigClassConfig" for "\UmcConfigClassConfigMapper" generation does not exist.....

But this one works.

<virtualType name="UmcBaseUiDataProviderModuleFormModifierPool" type="Magento\Ui\DataProvider\Modifier\Pool">
    <arguments>
        <argument name="modifiers" xsi:type="array">
            <item name="system" xsi:type="array">
                <item name="class" xsi:type="string">Umc\Base\Ui\DataProvider\Module\Form\Modifier\System</item>
                <item name="sortOrder" xsi:type="number">1</item>
            </item>
        </argument>
    </arguments>
</virtualType>
<type name="Umc\Base\Ui\DataProvider\Module\Form\DataProvider">
    <arguments>
        <argument name="pool" xsi:type="object">UmcBaseUiDataProviderModuleFormModifierPool</argument>
    </arguments>
</type>

What should be placed in the general di.xml and what should be placed in the area specific di.xml?

Note: I've cleared the cache and the generation folder.


texts: Magento Grandtotal Issue with Incl. Of Tax System and Paypal Tax with discounted price?

texts:
I am facing an issue with Magento1.9.2.4. My store is Incl. Of Tax, having 7% tax rate.

Here is the admin panel tax settings screen-shot:

When I am going to place order with shipping (Incl. of Tax 7%) and Products (Incl. of tax 7%) and coupon discount.
The grand total amounts are not what they should be,Like:
$p1 = $9.00
$p2 = $86.00
discount =$9.00
Shipping = $10.00

So, Subtotal after discount is : (9+86) - 9 = 86.00 on which the tax will calculate ((86*7)/107)= 5.6262 = 5.63
Shipping also has 7% tax:
((10*7)/107) = 0.6542 = 0.65
So the total tax is : 6.28 [to recheck via grand-total incl. of tax ((96*7)/107)]
and if I add the shipping
to Subtotal after discount = 86 + 10 = 96
but it is showing 95.99

which is completely wrong.

Here are cart page screen-shot:

And one more thing is, the same scenario will give different tax of paypal.

I am checking on default Magento no customization.


texts: sales_order_creditmemo_save_after event in magento 2?

texts:
I just check the event list of magento 2

There is no sales_order_creditmemo_save_after event so which event is call after creditmemo save from admin?


texts:
This should be a simple enough question, but I am unable to locate the answer.

What library does EE use for tying in to Solr? Is it a custom library? Is it based on the unmaintained library found at https://code.google.com/p/solr-php-client/ ? Maybe Solarium? PECL?


texts: Magento 1.9.2.1 - Images in frontend and backend not showing

texts:
I've been on this issue since 1.9.2.1 was released. In 1.9.1 everything worked like a charm. When upgrading to 1.9.2.1, all images in the frontend and backend can't be loaded for some reason. Even if you put in the URL to the image, it doesn't show it.

Been looking online and playing around with new installs and finally ended up installing an shop with the standard demo content.
Because that should at least work right...?

Address: http://www.rahsite.nl/winkel/

Note: This is a fresh 1.9.2.1 install with demo content. Nothing is changed what so ever.

My hosting guys point to Magento for this issue (Also because they don't know Magento I assume...).

My question: What can I do to resolve this and where do I start?


texts: CSV imported product is not showing in Magento front end

texts:
I have uploaded product in CSV format. I set the product as enabled, stock as in_stock and quantity as 100 in CSV file, But the product is not showing in front end pages, But when I just open and save the product from admin panel the product is listing in front pages.
Any help is appreciable.
Thank you in advance

    $product = Mage::getModel ( 'catalog/product' );
    $product = Mage::getModel ( 'marketplace/product' )->setProductInfo(   $product, $set, $type, $categoryIds, $sellerId, $groupId, $imagesPath );
$product->setAttributeSetId($attributeSetID);
        $product->setTypeId('simple');
        $product->setSellerId($sellerId);
        $product->setGroupId($groupId);
        $product->setCreatedAt(strtotime('now'));
        $product->setName($productName);
        $product->setManufacturer($barndOptionValue);
        $product->setModel($ModelOptionValue);
        $product->setProductcode($productCode);
        $product->setRoomBudget($room_budget);
        $product->setShortDescription($shortDescription);
        $product->setDescription($Description);
        $product->setSku($sku);
        $product->setDimensionUnits($diamensionUnitValue);
        $product->setLenghtWithoutPacking($diamensionLengthWithoutPacking);
        $product->setWidthWithoutPacking($diamensionBreadthWithoutPacking);
        $product->setHeightWithoutPacking($diamensionHeightWithoutPacking);
        $product->setWeightUnit($weightUnitValue);
        $product->setWeight($weightWithoutPacking);
        $product->setWeightWithPacking($weightWithPacking);
        $product->setRoom($roomIds);
        $product->setMinimumOrderQuantity($minimumOrderQuantity);
        $product->setOrderDispatchLeadTime($leadDispatchTime);
        $product->setLengthWithPacking($dimensionWithPackingLenght);
        $product->setWidthWithPacking($dimensionWithPackingBreadth);
        $product->setHeightWithPacking($dimensionWithPackingHeight);
        $product->setMsrp($msrp);
        $product->setPrice($price);
        $product->setShippingcostIncluded($shippingcostIncluded);
        $product->setSellerProductcode($sellerProductcode);
        $product->setVisibility(4); // catalog, search
       $product->setStatus(1); // enbled
       $product->setTaxClassId(0);
        $product->setSellerShippingOption(17);
        $product->setWebsiteIds(array(1));
    $product->setData('group_price',$groupPrice);
    $stockData = $product->getStockData();
    $stockData['qty'] = $stock;
    $stockData['is_in_stock'] = 1; //
    $stockData['manage_stock'] = 1;
    $stockData['use_config_manage_stock'] = 0;
    $product->setStockData($stockData);
    $product->save ();


texts: Magento orders going to close after only one return

texts: As an example if a customer purchase 5 items and later returns 1 the order closes after that first return. Is there a way to keep the order open so that we can do more returns if needed?


texts: Magento 2 : Why the Extensions installation process from admin is not same as in Magento 1?

texts:
This may be a small question but I am curious, why is the extension installation process from admin in Magento 2.x not same as in Magento 1.x  (viz. Paste extension key to install) ?

To be brief:

In Magento 1

  We can install an extension or package by simply Pasting the extension key.

In Magento 2

  For upgrade or update, we must use the same authentication keys that were used to install the Magento software.

Why is the whole installation process different ?
Why is the extension installation process in Magento 2, linked to the authentication keys ?

A brief answer will be appreciated.


texts: Page display error after changing base url

texts:
I am setting up a new Magento 2 store on AWS.

After installed M2 on my server (13.210.72.64), the site'base url was 13.210.72.64/magento2 and then I changed it to 13.210.72.64 in the admin panel(configuration->web). The site now is not working correctly.
I am pretty new to Magento 2.

Please help me out.Any help is greatly appreciated.


texts:
have this custom model:

class Mynamespace_Mymodule_Model_Convert_Adapter_Unblock extends Mage_Dataflow_Model_Convert_Adapter_Abstract
{
    protected $_customerModel;

    public function load()
    {
        // Stub
    }

    public function save()
    {
        // Stub
    }

    public function getCustomerModel()
    {
        if (is_null($this->_customerModel)) {
            $_customer = Mage::getModel('customer/customer');
            $this->_customerModel = Mage::objects()->save($_customer);
        }
        return Mage::objects()->load($this->_customerModel);
    }

    public function saveRow(array $importData)
    {
        $_customer = $this->getCustomerModel();

        if (empty($importData['reference'])) {
            $message = Mage::helper('catalog')->__('Skip import row, required field "%s" not defined', 'reference');
            Mage::throwException($message);
        }
        //   .......  code here
        return true;
    }
}

It reads a custom csv file from var/import/custom.csv. It has only one column called reference . Its a dataflow profile

My silly questions are:

How can I run it ?
Is it possible to run it from console? If Yes, HOW ?
I am using n98-magerun. Is it possible to run it from it ? if Yes, How ?

Thank you :)


texts: Magento 2 - How to change number of products per page dynamically?

texts:
In Magento 2, I try to change number of products in category pages dynamically.
For exemple categories 1 and 2 will have default number value (10), and category 3 and 4 will have one less product, only 9 products per pages.
I will use a custom module attribute to identify which category need less product per page.
Do you know how can achieve this ?
Thanks


texts:
I'm updating a Magento 1.x extension to Magento 2.x. The extension adds some dynamic css to the head based on configuration values in the backend (for instance colorpickers that save a hex value to be assigned to an element).

The Magento 1.x extension uses a rewrite of html_head to add the following code:

protected function _prepareLayout() {
    parent::_prepareLayout();
    if($head_block = $this->getLayout()->getBlock('head')) {
        $styles_block = $this->getLayout()->createBlock('Mage_Core_Block_Template', 'custom_styles')->setTemplate('module/styles.php');
        $head_block->setChild('custom_styles', $styles_block);
    }
}

And the styles.php looks somehting like this:

<style type="text/css">
<?php
$model = Mage::getModel('module/model')->getCollection();
foreach ($model as $item) :
?>

.element { background-color: <?php echo $item['bgcolor'] ?>; }

<?php
endforeach;
?>
</style>

This works great in Magento 1.x but I have yet to figure out how to do this for Magento 2.x.


texts: I have a form and on submit of that form one email is going on one ajax action. After the email has been done i want it to redirect to checkout page with one simple product of $100. Please help on this. I cant use the same action.


texts: Uncaught ReferenceError: Unable to process binding "if: function(){return isExcludingDisplayed() }" After Magento 2.3.4 Upgrade Checkout Cart Page

texts:
Hi @all, actually after upgrading from Magento 2.2.4 to Magento 2.3.4 below error is
  showing on checkout cart page.

  After reaching to checkout cart page Ajax loader is just keep on
  moving and shipping rates are not loading due to below error in browser
  console.

Uncaught ReferenceError: Unable to process binding "if: function(){return isExcludingDisplayed() }"
Message: Unable to process binding "if: function(){return haveToShowCoupon() }"
Message: haveToShowCoupon is not defined
    at if (eval at createBindingsStringEvaluator (knockout.js:2982), <anonymous>:3:55)
    at ko.computed.disposeWhenNodeIsRemoved (knockout.js:4381)
    at Function.evaluateImmediate_CallReadThenEndDependencyDetection (knockout.js:2173)
    at Function.evaluateImmediate_CallReadWithDependencyDetection (knockout.js:2140)
    at Function.evaluateImmediate (knockout.js:2101)
    at Object.ko.computed.ko.dependentObservable (knockout.js:1954)
    at init (knockout.js:4380)
    at knockout.js:3358
    at Object.ignore (knockout.js:1470)
    at knockout.js:3357

  If anyone having an idea, please guide me. Thanks in Advance!!!.


texts: Magento Redirect customer to checkout page

texts:
I try to find a solution, I have a special case, Let's say that my customers add something in cart, then they need to login or register. So I want to do something like this: after login/registration if they have a product in cart to be redirected to the checkout page, if they don't have a product in cart to be redirected to the my account page. Is this possible? Or exist for Magento a extension like this?

Thank you


texts:
A bit of a simple one, I just want to load a category collection and for it to include disabled categories either on their own or along with the enabled categories.

It seems that the standard collection call has an automatic 'active' filter on it:

Mage::getModel('catalog/category')->getCollection();

If anyone's done this before it would be a great help!


texts: Magento 2 - Importing prices for multiple store views using Magmi

texts:
I am trying to update prices using Magmi on 2 store views but I am having issues. Here is my setup.

store,sku, price
abc, 1001, 5.00
bab, 1001, 7.00

It worked perfectly.

The question is:

  Now I use two lines to make it clear to magmi that there are two
  different prices. Is there a way to get the same result by writing in
  a single line?


texts:
I am using magento 1.9 and when adding product from product view page, product gets added to cart, but no success message is shown, and mini cart also does not get updated. When I move to any other page, message displays there. and also if I view checkout page, product shows there in cart

http://boho-magic.com/rings/long-sterling-silver-925-ring-statement-401.html

Please help. I am trying but nothing works.


texts: Tips and tricks for fast Magento2 localhost development

texts:
Does anyone has some ideas or tips for improving magento2's performance on localhost taking into consideration that you are working without cache and other stuff that helps the loading speed.

How much do you think it affects the OS in this matter ? (Windows vs Linux vs OS X)

Thank you


texts: Magento2 Inventory Listing per store view?

texts:
I have a multisite magento 2.2.5 and trying to list out each sku that has less then a specific inventory but trying to list them out per store view.

Below is my sql

SELECT catalog_product_entity.entity_id, catalog_product_entity.sku, cataloginventory_stock_item.qty FROM catalog_product_entity, cataloginventory_stock_item
                        where catalog_product_entity.entity_id = cataloginventory_stock_item.product_id AND qty < 250"

how do I edit it to look at a specific store view?


texts:
Im searching since a week how i can get a store_id / website_id for a given language.

Like:

$countryId = 'DE'; // or country = Germany
foreach (Mage::app()->getStores() as $store) {
    if($store->getCountryId() === $countryId){
        return $store;
    }
}

How could i solve this?

EDIT: 03022016

Im now using the general/country/allow config (system/general/allowed countries)

This will get the first store that is using the given country.

Ofc the country could be used on multiply stores, but any other solution i found got the same problem.

The point why im using this solution is that the IDs are real country_id s (not editable codes-strings).

public function getStoreIdByCustomerCountryId($countryIdCustomer)
{
    $countryIdReturn = null;
    $countryIdCustomer = trim((string)$countryIdCustomer);
    if (!strlen($countryIdCustomer)) {
        return false;
    }
    foreach (Mage::app()->getStores() as $store) {
        if (!$store->getIsActive()) {
            continue;
        }
        foreach (
            explode(',', $store->getConfig('general/country/allow'))
            as $countryId
        ) {
            if (trim((string)$countryId) === $countryIdCustomer) {
                $countryIdReturn = $store->getId();
                break 2;
            }
        }
    }
    return $countryIdReturn;
}


texts: Payment method section in admin redirected to home page

texts:
We have one payment module appmerce_migs installed in magento & whenever we click on Payment Method tab in admin in magento then it is redirected to home page. If we disable this module then working fine.

The same module we have in local & there everything working fine.

We checked in var/log but there is nothing.

What is the issue! Can anyone please help?

Thank you.


texts: How to add new theme name to grunt CLI command to run grunt tool in Magento 2 with CLI commands instead of editing less.js and themes.js file?

texts:
I read  this , But I wanna add new theme name to grunt CLI command with some CLI commands not editing a less.js and thmemes.js  manually.Is there any solution for this
something Like (magento2 add-new-them-to-grunt --theme-name-- --theme-files--)


texts: Is it possible to insert a multi line comment tag into an xml

texts:
how to generate multi line comment in xml using custom script

<breakfast_menu>
    <food>
        <!--
        <name>Belgian Waffles</name>
        <price>$5.95</price>
        -->
        <description>Two of our famous Belgian Waffles with plenty of real maple syrup</description>
        <calories>650</calories>
    </food>
</breakfast_menu>


texts: Magento 2 Mass Product Action module (append text to products name , update price....)

texts:
I need the code of the module magento 2 which allows to add mass action  (append text to products name , update price....) I am blocked help me
please


texts: Magento url rewrite issues - all pages without www redirect to homepage

texts:
Every page without w w w redirects to the homepage. Pages work normally with the w w w & the homepage redirects from non w w w to w w w.

(I want w w w only on the website)

I have tried changing configuration / web /auto redirect to base url but this just makes all of the pages accessible with w w w or without so causes duplicate content.