texts: How can I dynamically add fields to a widget's options?

texts:
I am creating a standard Magento widget. In the options tab for the widget I have a field. This field is for filters in the form of key:'value' pairs. I would like the user to be able to dynamically create as many filters as they need.

So, ideally the user clicks a button 'Add new Filter' and a new field is generated below the original field.

I have an idea that I can use a custom <source_model>, but I am not sure what javascript methods or Mage classes already handle dynamic buttons such as this. I'm thinking there has to be an easy way.

My widget.xml file looks like this:

<?xml version="1.0"?>
    <widgets>
      <namespace_module type="module/links">
        <name>Widget Name</name>
    <description>Display a gizmo</description>
    <parameters>
      <filters>
        <label>Filters</label>
        <visible>1</visible>
        <required>0</required>
        <type>text</type>
        <source_model>module/filters</source_model>
      </filters>
    </parameters>
    </namespace_module>
    </widgets>

Then I have app/code/community/Namespace/Module/Model/Filters.php

which looks like:

class Namespace_Module_Model_Filters {

  public function toOptionArray() {
    return array(
      array('value' => 'val', 'val' => '1'),
      array('value' => 'val2', 'val2' => '2'),
      array('value' => 'val3', 'val3' => '3'),
    );
  }

  // Can I do anything here to generate dynamic fields?

}

Perhaps this is not the correct way to go about this? Is it possible to create a custom <type> and generate the buttons there? Maybe I just need more coffee ["])

UPDATE: I'm now looking at the <type>multiline</type> parameter, to see if I can use that. However, I think I'm still going to need to create a custom multiline. The reason is that Varien_Data_Form_Element_Multiline has the line count hardcoded:

public function __construct($attributes=array())
    {
        parent::__construct($attributes);
        $this->setType('text');
        $this->setLineCount(2); // hardcoded
    }


texts: Product edit form issue in admin panel magento2

texts:
Here is my etc/adminhtml/events.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="adminhtml_catalog_product_edit_prepare_form">
    <observer name="custom_product_fields" instance="Vendor\Module\Observer\CatalogProductEditPrepareForm" />
</event>

Here is my Observer/CatalogProductEditPrepareForm.php

  <?php

  namespace Vendor\Module\Observer;
  use Magento\Framework\Event\ObserverInterface;

  class CatalogProductEditPrepareForm implements ObserverInterface
  {
protected $_coreRegistry;

/**
 * @param \Magento\Framework\Registry  $coreRegistry
 */
public function __construct(
    \Magento\Framework\Registry  $coreRegistry
) {
    $this->_coreRegistry = $coreRegistry;
}

/**
 * product from prepare event handler.
 * @param \Magento\Framework\Event\Observer $observer
 * @return $this
 */
public function execute(\Magento\Framework\Event\Observer $observer)
{
    $form = $observer->getForm(); // $observer contain form object

    // get your group element in which you want to add custom filed
    $fieldset = $form->getElement('product-details');

    if ($fieldset) {

        // get current product if you want to use any data from product
        $product = $this->_coreRegistry->registry('product');
        $fieldset ->addField(
            'custom-field-1',
            'text',
            [
                'name' => 'custom-field-1',
                'label' => __('Custom Field 1'),
                'id' => 'custom-field-1'
            ]
        );

        $fieldset ->addField(
            'custom-field-2',
            'text',
            [
                'name' => 'custom-field-2',
                'label' => __('Custom Field 2'),
                'id' => 'custom-field-2'
            ]
        );

        // You can set any data in these elements for display default value
        $form->addValues(
            [
                'custom-field-1' => 'data according to you', // ex. $product->getName()
                'custom-field-2' => 'data according to you'
            ]
        );
     }
    return $this;
  }
 }

I am trying to add custom field into product details tab. seems my event observer is not working. Please anyone help on this. Thanks


texts:
magento2 uses monolog for logging.i'm able to log strings.but i'm not able to log objects and arrays.can you give anyone syntax for this.i'm getting following error.

Object of class 'some class' could not be converted to string.

$object_manager->get('Psr\Log\LoggerInterface')->info("some_text");


texts: Magento 2 order grid custom mass action 404 page not found

texts:
view/adminhtml/ui_component/sales_order_grid.xml

<?xml version="1.0" encoding="UTF-8"?>
<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
    <listingToolbar name="listing_top">
            <massaction name="listing_massaction" component="Magento_Ui/js/grid/tree-massactions">
                <action name="order_mass">
                    <argument name="data" xsi:type="array">
                        <item name="config" xsi:type="array">
                            <item name="type" xsi:type="string">order_mass</item>
                            <item name="label" xsi:type="string" translate="true">Action name</item>
                            <item name="url" xsi:type="url" path="ordermass/massaction/massAction"/>
                            <item name="confirm" xsi:type="array">
                                <item name="title" xsi:type="string" translate="true">Attention</item>
                                <item name="message" xsi:type="string" translate="true">Do you want to complete the selected row record?</item>
                            </item>
                        </item>
                    </argument>
                </action>
            </massaction>
    </listingToolbar>
</listing>

etc/adminhtml/routes.xml

<?xml version="1.0" encoding="UTF-8"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
    <router id="admin">
        <route frontName="ordermass" id="ordermass">
            <module name="Vendr_Modulename"/>
        </route>
    </router>
</config>

Controller/Adminhtml/MassAction/MassAction.php

<?php

namespace Vendor\Modulename\Controller\Adminhtml\MassAction;

use Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection;
use Magento\Backend\App\Action\Context;
use Magento\Ui\Component\MassAction\Filter;
use Magento\Sales\Model\ResourceModel\Order\CollectionFactory;
use Magento\Sales\Api\OrderManagementInterface;

/**
 * Class MassDelete
 */
class MassAction extends \Magento\Sales\Controller\Adminhtml\Order\AbstractMassAction
{
    /**
     * @var OrderManagementInterface
     */
    protected $orderManagement;

    /**
     * @var \Magento\Framework\App\Filesystem\DirectoryList
     */
    protected $directoryList;

    /**
     * @param Context $context
     * @param Filter $filter
     * @param CollectionFactory $collectionFactory
     * @param Shipping $shippingHelper
     */
    public function __construct(
        Context $context,
        Filter $filter,
        CollectionFactory $collectionFactory,
        OrderManagementInterface $orderManagement,
    ) {
        parent::__construct($context, $filter);
        $this->collectionFactory = $collectionFactory;
        $this->orderManagement = $orderManagement;
    }

    /**
     * Hold selected orders
     *
     * @param AbstractCollection $collection
     * @return \Magento\Backend\Model\View\Result\Redirect
     */
    protected function massAction(AbstractCollection $collection)
    {
       echo 'Test';
    }
}

But I got a 404 page not found, any suggestion, please?


texts: Magento 2.3 setup page not Rendring on installation

texts:
I've setup WSL(Windows Subsystem for Linux) on my machine for development purpose with following stack.

Ubuntu : 18.04
PHP Version : 7.2
nginx : 1.14.0
mysql : 5.7

I've already installed all required prerequisites/PH Extensions of Magento 2.3.x

now I'm going to install Magento 2.3.2 but Magento not working properly.

I've extracted .tar file and execute following commands

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 {} \;
chmod 777 ./app/etc
chmod 644 ./app/etc/*.xml
chown -R :www-data .
chmod u+x bin/magento

while installing Magento setup page not rendering properly. Wordpress and CI works fine on the server it mean there is not the server configuration issue.

I'm not sure but i think there is no file permission issue, I'd installed magento 2.3.x so many times with Apache, this this is the first time I'm installing it with nginx

the output of magento setup page isn't completely blank kindly please visit URL

Output: https://snipboard.io/CfRilJ.jpg
Sourcecode: https://snipboard.io/vicz3S.jpg


texts:
I'm searching for a solution with the magento buildin way to create html select blocks. Using magento CE 1.9.0.1

My code is:

$this->setChild('designs',
        $this->getLayout()->createBlock('adminhtml/html_select')
            ->setData(array(
                'id' => 'product_option_{{id}}_design',
                'class' => 'required-entry select-type-design'
            ))
    );

    $this->getChild('designs')->setName('product[options][{{id}}][design]')
        ->setName('product[options][{{id}}][design]')
        ->setOptions($options);

$options is a array of the possible selectoptions.

How can I make one option to be selected?

I can see the functionality in the code /var/www/geschenkidee/web/app/code/core/Mage/Core/Block/Html/Select.php in the proteced method _optionToHtml. But I dont see a way to set this infomation.


texts:
I'm trying to load a custom phtml for the frontpage. I found this topic and it got me off to the right track.

I created my /app/design/frontend/theme/skin/Magento_Theme/layout/cms_index_index.xml
and added this code;

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
   <referenceContainer name="page.top">
     <block class="Magento\Framework\View\Element\Template" name="engels_home" template="html/engels_home.phtml">
        <arguments>
            <argument name="section" xsi:type="string">homepage</argument>
            <argument name="position" xsi:type="number">0</argument>
        </arguments>
     </block>
  </referenceContainer>
</page>

So I figured I have to create the .phtml file in app/design/frontend/theme/skin/Magento_Theme/templates/html/engels_home.phtml based on the logic that a layout file in Magento_Theme would point to a template file in that same structure. I guess I was wrong here, because I saw that other references where made to the Magento_Store folder. So I added the engels_home.phtml to that folder. And then to the rest. Then I spread it out all over the filesystem just to see what sticks.

Nothing did, my system.log keeps saying the same thing:

  main.CRITICAL: Invalid template file: 'html/engels_home.phtml' in
  module: '' block's name: 'engels_home' [] []

no matter where I put the file.

Does anyone know where to put it, or better yet, understand why all of this above wouldn't work? It's driving me nuts at this point.

PS. I'm sorry to knowingly create a "duplicate" post, but this is the downside of the reputation system. I can ask questions, but not (yet) comment on others..


texts: Change shipping carrier name issue in Magento 1

texts:
I need to change the shipping name displayed everywhere in Magento (both frontend and backend) for 2 stores.
This is for backend order:

I need to change in transactional emails, checkout shipping step, invoice, etc. I found the template file for almost all of them. I can do the logic there.

If store = X or store = Y display ABC instead of Shipping Option-testare_shipping.

The fact is I don't wanna do that, I am looking for a more elegant solution. It is important that I'm not allowed to change the database :). If there any idea to do that, maybe with an observer? rewrite core functionality etc?

Thank you


texts: get confirmation before removing item from cart in magento 2?

texts:
I want to remove the items from cart from
 checkout\cart
 page, but before that i wanna to get a confirm from user.
it is possible to get confirmation from user after that i can remove the item from cart if he/she click OK, else he/she click cancel it should not delete the item from cart.

I have tried some examples but still when i click on cancel the item gets removed from cart.

here is the code we need to change:-

<a href="#"
   title="<?php echo $block->escapeHtml(__('Remove item')); ?>"
   class="action action-delete"
   data-post='<?php /* @escapeNotVerified */ echo $block->getDeletePostJson(); ?>'>

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

If anyone get the solution?


texts:
I am looking for an alternative to Shopify. My store after developing was blocked with probably no reason (typical situation with Shopify). So I am really afraid what's goes wrong at the most important moments. That`s why I am looking for an alternative to Shopify. And I think Magento is something I am looking for.

So I have a  question:

1) Can I protect myself and my store from blocking ? I mean can I provide To Magento Team all necessary information (like ID, business info/details and so on...) to get verified and approved before launching to avoid any troubles like blocking my store in the future?


texts:
Is there a way to export products of a particular category in Magento?

If not, what are the tables involved if I want to do an custom SQL query?


texts: How can I add a column to Category -> Category -> Products in Category grid in magento 2

texts:
I would like to add an extra column based on a product attribute <my_attribute_code> in the product  grid that appears when editing a category in the section "Products In Category" ideally before the SKU Column

Is it possible?


texts: Magento 2 rest api - Client denied by server configuration

texts:
I am using magento rest api to manage cart. My frontend runs on reactjs.
Here is my apache virtual host looks like :

<VirtualHost *:80>
        DocumentRoot /var/www/html/magento/pub

        <Directory /var/www/html/magento/pub>
                Options Indexes FollowSymLinks
                AllowOverride All
                Require all granted
        </Directory>
</VirtualHost>

.htaccess in pub folder is same as - https://raw.githubusercontent.com/magento/magento2/2.2-develop/pub/.htaccess

When I am adding anything to cart using : POST - http://localhost/magento/rest/V1/carts/mine
I am getting the error 404 in response.
I checked the apache log and found this

Client denied by server configuration: /var/www/html/magento/pub/rest

All other api's are working.
Please help.


texts:
I built an extension for Magento 2 and now I want to package it using the following guide: http://devdocs.magento.com/guides/v2.0/extension-dev-guide/package/package_module.html

There is a sample composer.json: http://devdocs.magento.com/guides/v2.0/extension-dev-guide/package/package_module.html#sample-composerjson-file

I am wondering what is really necessary to state in the require field as Magento more or less only works correctly if all modules are enabled. There are Magento modules which depend on each other, for example Magento will certainly use the magento/framework package. So can I omit that in my own composer.json as I can assume the framework is certainly available? For my first composer.json I looked at all the constructors and use clauses in my extension's code and these are all modules which are used. But is this amount of required packages really necessary?

"require": {
    "php": "~5.5.0|~5.6.0|~7.0.0",
    "magento/module-backend": "100.0.*",
    "magento/module-customer": "100.0.*",
    "magento/module-product": "100.0.*",
    "magento/module-wishlist": "100.0.*",
    "magento/module-cms": "100.0.*",
    "magento/module-catalog": "100.0.*",
    "magento/module-eav": "100.0.*",
    "magento/module-store": "100.0.*",
    "magento/module-ui": "100.0.*",
    "magento/framework": "100.0.*"

},


texts: Not able to acess both frontend and backend ..!

texts:
Am new to magento using 1.9.2,Suddenly am not able to acess my site both in frontend and backend.It showing Error msg like these

There has been an error processing your request

SQLSTATE[28000] [1045] Access denied for user 'aerowysg_indianskart'@'localhost' (using password: YES)

I also flushed var/cache var/session through Ftp,
I also seen app/etc/local.xml all details are good.I dont know what to do next!! Can anyone help me please,I have access to C-panel and ftp.

NOTE:I doesn't download any extensions,No changes made in blocks/modules


texts: Get all products of a category created between 2 days

texts: I need to get all the products created between 2 dates of a specific category. Can you please provide me a coding to get this. Im totally new for magento. I tried this but didnt worked. Please help. Im using magento 1.9.


texts: Programmatically change all categories for all store views

texts:
I want to change some data of all categories (all store views).

This is my code:

$category = Mage::getModel('catalog/category');
$tree = $category->getTreeModel();
$tree->load();
$ids = $tree->getCollection()->getAllIds();
asort($ids);
$categories = array();
if($ids) {
    foreach ( $ids as $id ) {
        $cat = $category->load($id);
        if($cat->getId()) {
            $cat->setName($cat->getName().' add some text');
            $cat->save();
        }
    }
}

Unfortunately I get only the data of the second language.
I need to change data of all languages (store views).

Does anyone has an idea?


texts:
I recently got a project in Magento 2.1 CE (from scratch). Although the officially recommended of PHP is 5.6, I am more inclined to go with PHP7.

I was looking for a Pros and Cons list of going with either of the PHP versions.

Any thoughts people ?


texts: override base template file in adminhtml [Magento-Ui backend]

texts:
I created custom grid module using ui component layout

In that i want to add new button near to filter button.

That new button should functions like action drop down function i.e capture all selected items in grid.

For adding new button i followed link

Magento 2 override module-ui from custom theme

I think the above link for front end theme development. But i want back end module

I tried to override following file in my admin module as follows in link above but its fails.

Magento\vendor\magento\module-ui\view\base\web\templates\grid\filters\filters.html


texts: Magento 2 add title to footer links block

texts:
I have tried to add a h3 header to the footer links block using the approach outlined here:

Adding title to cms footer block

This looks difficult to maintain and it wasn't quite what I wanted.

I can add a static block with my own links and probably get an easier to maintain solution, however, I would prefer to do it the Magento2 way.

It is possible to specify a template for the links block and I can do this but not be able to pull through the actual links.

        <referenceBlock name="footer_links">
        <action method="setTemplate">
            <argument name="template" xsi:type="string">Magento_Theme::html/custom.phtml</argument>
        </action>
        <block class="Magento\Framework\View\Element\Html\Link\Current" name="glossary">
            <arguments>
                <argument name="label" xsi:type="string">Delivery and returns</argument>
                <argument name="path" xsi:type="string">delivery-information</argument>
            </arguments>
        </block>
        <block class="Magento\Framework\View\Element\Html\Link\Current" name="deliveryinfo">
            <arguments>
                <argument name="label" xsi:type="string">Glossary</argument>
                <argument name="path" xsi:type="string">glossary</argument>
            </arguments>
        </block>
    </referenceBlock>

Can anyone help with an elegant solution to this?


texts: Hide Current Store from link in store switch in multi store

texts:
I am facing one problem of multi-store option. Both stores are showing but I want to hide the current store and only show the other stores.

These two options are showing at top left side.

Store URL: www.image.pk

Magento 1.9.1.0 version

If we are in Export Leftovers than only polo republica show.
if we are in polo republica than only export leftovers shows.

code for un-order List style:

<?php foreach ($this->getGroups() as $_group): ?>

<a href="<?php echo $_group['home_url'];?>"><?php echo $this->htmlEscape($_group['name']);?>

<?php endforeach; ?>


texts: How can I set up and use cron jobs in Magento 1.7 on Mac?

texts:
Is there a built-in cron job functionality in Magento and what is the suggested way to use cron job (in particular for updating stock quantities of products, but this is not important here in this question)? We have a .CSV that is periodically updated and we want the cron job to take it periodically and process it, so we want to use cron and not any other way. Cron job is way we want to go, but I want to know more about cron job integration in Magento. What is the best way to do this? I added the Magento cron using this:

crontab -e

and added this line there:

*/1 * * * * /bin/sh /Applications/XAMPP/htdocs/mymagento/cron.sh

I also created the cron using a module, like this:

<config>
    ...
    <crontab>
        <jobs>
            <mynamespace_mymodule_test>
                <schedule><cron_expr>*/1 * * * *</cron_expr></schedule>
                <run><model>mymodule/observer::test</model></run>
            </mynamespace_mymodule_test>
        </jobs>
    </crontab>
    ...
</config>

I created the observer (in Mynamespace/Mymodule/Model/Observer.php) and its method like this:

class Mynamespace_Mymodule_Model_Observer {

    public function test(){
        error_log("success!!!!!");
    }
}

So I expect to get that message logged, but it is not. It's never logged. I can see the cron in the cron_schedule table if I run [mymagento]/cron.php in the browser, but the message is not logged. What am I missing here?


texts:
Is there any way to copy search-block in magento2?

I need to place it on completely different place on mobile resolution, but in order to so, i guess i need to copy it into another container. Any ideas?


texts: Hide shipping method when another available

texts:
In my Magento CE setup I have the WebShopApps Fastway couriers shipping method and I also have the Flat Rate Shipping Method on set to $0 for when the package either isn't valid for Fastway as it is to heavy or Fastway can't return a result for some reason, so the Flat Rate Method shows as "Contact us for a Shipping Quote".

My problem is that even when fastway returns options people are still choosing the "Contact us for a Shipping Quote $0" one and then I have to chase them to get them to pay the Fastway amount.

Is there some way to only show the Flat Rate Option if Fastway returns it's Error value (ie when it can't find a shipping amount) of "Please contact us for a shipping quote."


texts: Shipping option not selected on review page when I selected shipping method in paypal express account in Magento2

texts: If I already selected shipping Method in Paypal express account and redirect to Magento2 review page then shipping option not selected by default on review page.


texts: Magento Version 1.9.2 Clicked System in Admin and Receive Error:Invalid config field backend model: backup/config_backend_cron

texts:
I have everything running pretty well on my Magento site, but I keep running into this weird error when I click Configuration -> Advanced -> System

I have been searching for hours now trying to figure out the solution. I see a lot of people usually have a file missing or php class, but I have the app/code/core/Mage/Backup and associated files inside the folder along with the proper files in accordance. Per standards, you don't touch the Mage core files. So any ideas???

a:5:{i:0;s:62:"Invalid config field backend model: backup/config_backend_cron";i:1;s:1748:"#0 /var/www/html/dev/cpi-magento/app/code/core/Mage/Adminhtml/Block/System/Config/Form.php(328): Mage::throwException('Invalid config ...')
#1 /var/www/html/dev/cpi-magento/app/code/core/Mage/Adminhtml/Block/System/Config/Form.php(229): Mage_Adminhtml_Block_System_Config_Form->initFields(Object(Varien_Data_Form_Element_Fieldset), Object(Mage_Core_Model_Config_Element), Object(Mage_Core_Model_Config_Element))
#2 /var/www/html/dev/cpi-magento/app/code/core/Mage/Adminhtml/Block/System/Config/Form.php(164): Mage_Adminhtml_Block_System_Config_Form->_initGroup(Object(Varien_Data_Form), Object(Mage_Core_Model_Config_Element), Object(Mage_Core_Model_Config_Element))
#3 /var/www/html/dev/cpi-magento/app/code/core/Mage/Adminhtml/Block/System/Config/Edit.php(92): Mage_Adminhtml_Block_System_Config_Form->initForm()
#4 /var/www/html/dev/cpi-magento/app/code/core/Mage/Adminhtml/controllers/System/ConfigController.php(107): Mage_Adminhtml_Block_System_Config_Edit->initForm()
#5 /var/www/html/dev/cpi-magento/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Adminhtml_System_ConfigController->editAction()
#6 /var/www/html/dev/cpi-magento/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('edit')
#7 /var/www/html/dev/cpi-magento/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#8 /var/www/html/dev/cpi-magento/app/code/core/Mage/Core/Model/App.php(365): Mage_Core_Controller_Varien_Front->dispatch()
#9 /var/www/html/dev/cpi-magento/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#10 /var/www/html/dev/cpi-magento/index.php(84): Mage::run('', 'store')
#11 {main}";s:3:"url";s:104:"/dev/cpi-magento/index.php/admin/system_config/edit/section/system/key/d4cb4bbf89cbd80524f1e1527eaaf549/";s:11:"script_name";s:26:"/dev/cpi-magento/index.php";s:4:"skin";s:5:"admin";}


texts: How can i add custom.less file for a specific store in magento 2?

texts:
How can we add custom.less file for specific store in magento 2 ?

Description:  Assume we have 2 stores,in store 1 i want to create custom1.less and in store 2 i want to add custom2.less file so how it will be possible ?


texts:
I am planning to update Magento to latest version my current version is Magento ver. 1.9.0.1
I want to up upgrade it to ver. 1.9.1.0

What could be easiest and best way as I am not Magento expert?

What I though is Magento > admin > magento connect manager >

There I click check for updates to update it to latest one.

Is that only I have to do or what else steps needed.


texts: How to calculate shipping cost based on "City" instead of "State"?

texts: I am looking for a solution to modify Magento 1.9.3 in order to calculate the shipping cost according to City when checkout. Could anyone give me some pointers?


texts: How to add DOB field only on customer Edit page but not in registration page

texts: I want to display DOB field at edit and not in Registration page.


texts: Using SOAP V2, I encounter some conflict

texts:
A: http://[magento site]/api/v2_soap/index/ - error 500

B: http://[magento site]/api/v2_soap/index/wsdl/1/ - Working

Formerly the A is working to my old site which have 5.5 PHP version and now I migrated to another site which have 5.2 PHP version which cause the A: getting error 500 and now I'm using the B: which is working now. My concern is that there is a 3rd party connecting to the site which is using the A: and now there getting issue on getting any output from the site.

Thanks in advance


texts:
I have my layered navigation set up so that the user can filter by category, and this will filter the results on the page and stay on the category the filter was placed on e.g.

I have categories like so:

Balls

Rugby Balls

large
small

Football balls

If i am on rugby balls, in my layered navigation i have the option to filter for small or large rugby balls and the results are shown on the rugby balls page.

What i would like to do is instead of getting the results filtered, i would like, when the user wants to see whats in a sub category (large balls, small balls) they click on the link under the categories filter, but then actually get taken to the subcategory page instead of receiving filtered results.

Is there any way to do this?


texts: Magento 2 - Place an order without sending email

texts:
I'm using the following code to place an order programmatically in Magento 2:

    // Configure the quote
    $quote = $this->cart->getQuote();
    $quote->setInventoryProcessed(false);
    $quote->setPaymentMethod('custom_gateway');
    $quote->save();

    // Set the payment method
    $payment = $quote->getPayment();
    $payment->importData(['method' => 'custom_gateway']);

    // Update the quote
    $quote->collectTotals()->save();

    // Place the order
    $this->cartManagement->placeOrder($quote->getId());

This code is creating the order as expected, but is also sending an email to the shopper.

I would like to send the confirmation email at a later stage in the process, only when the payment has been confirmed.

How can I place an order without notifying the customer?


texts: Remove required redirect from Observer Model?

texts:
The following module does what I intended, direct a visitor to the cart with a quote id from the sales_flat_quote table specified using the "quote" GET variable, and it will restore the contents of that cart.

The only way I could get this to work was to add a redirect at the end, a redirect in a "Model" class seems like the wrong approach (this is my first foray into Magento programming). Is there a better way to approach this?

class XXX_RestoreCart_Model_Observer
{
    public function restoreCart(Varien_Event_Observer $observer)
    {
        $request = Mage::app()->getRequest();
        if (!$quoteId = $request->getParam('quote'))
            return false;

        $quote = Mage::getModel('sales/quote')
                 ->load($quoteId);
        if ($quote->getId()) {
            $quote->setIsActive(1)
                ->setReservedOrderId(NULL)
                ->save();

            $session = Mage::getSingleton('checkout/session');
            $session->replaceQuote($quote);

            Mage::app()->getResponse()->setRedirect(Mage::getURL('checkout/cart'));
        }
    }
}


texts: Importing product images in specific sequence / order

texts:
I import images into Magento as described here https://docs.magento.com/m2/ee/user_guide/system/data-import-product-images.html and here Product import csv images not getting imported :

I upload the images to pub/media/import, create a csv file with the skus and image filenames, and use the import functionality in Magento Admin for the csv file.

This works well, but the order of the images uploaded is not the way I want it to be: Alternative images are the first, and the base_image is the last in the sequence.

Our editor team is not so happy about that, because they have to manually click into each product and drag&drop the images into the correct order.

Is there any way to simplify this?


texts: Magento 2.1.3 EE - Cart Price Rule is missing "From" and "To" fields for expiration date

texts:
I am attempting to create some Cart Price Rules (essentially coupon codes). I believe M2 is supposed to support expiring coupon codes, just like M1.

  Click the Calendar next to the From field, and choose the first date
  the coupon can be used. The promotion will start at the beginning of
  that day.

  Click the Calendar next to the To field, and choose the last
  date the coupon can be used. The promotion will stop at the end of
  that day.

Source: Magento Enterprise Edition 2.1 User Guide

However, as you can see these screenshots, the From and To fields are not present in EE 2.1.3. I also recreated the issue in 2.1.2. However, the second screenshot shows that the fields are indeed visible in 2.1.2 Community Edition. I don't know if the EE/CE divide is actually relevant, but that's the only data point I've dug up so far.

I did discover that, in the salesrule table, I still see the from_date and to_date fields. So, as a developer, I would be able to create these coupon codes. However, as I cannot instruct my admin user to edit the database manually. Any suggestions with getting these fields to display in the admin would be much appreciated. Thank you!


texts:
F.y.i. The website I'm making is for buying trips on a sailboat.

My upsells file shows the upsell items that are added in the admin (like the upsells file would normally do). The product variable is 'created' like this:

<?php
foreach ($this->getItemCollection()->getItems() as $_link):
// where $_link contains all the product options
endforeach
?>

Later, I have an attribute called 'period' (a select) which shows the period when the ship sets sail.

<?php echo $_link->getAttribute('period'); ?>

Problem, it returns 'null', why?


texts: Magento 2 : Order confirmation email cron language picks up default language

texts:
I have multi language site.
Created a cron job to send order confirmation email.
I have created an email template for specific language.
The problem is, shipping and billing country is displaying in default language instead of order's store language.

How to fix this issue? I need to display the countries in specific order's store language.


texts: How to extend magento Admin customer Contoller, Block and Helper

texts:
In the Magento admin, I would like to do some changes in the following files.

app\code\core\Mage\Adminhtml\Block\Customer\Grid.php
app\code\core\Mage\Adminhtml\controllers\CustomerController.php
app\code\core\Mage\Adminhtml\Helper\Data.php

How can I extend these changes and implement without touching the core files. I have searched in google but i couldn't find the solutions.

Awaiting for valuable reply


texts: Product Flat Data indexing always keeps on Processing

texts: I have tried all approaches from truncating to checking table alter permission under DB but the Product Flat Data indexing always say on Processing and required re-indexing anybody has any idea about to solve this.


texts: Get product custom attribute values in Head/Header (SEO)

texts:
I'm having many custom attributes on my web site. If I want to use them on my view page, i just use the following code, which works great.

<?php echo $_product->getData("lp_ekran_vel"); ?>

Now, I have this situation where I need to display some custom attributes for:

<meta name="keywords" content="" />
<meta name="description" content="" />

When i use the following code it want work. What I'm doing wrong? Thanks

<meta name="keywords" content="<?php echo $_product->getData("lp_model"); ?>" />

UPDATED

Here is the code which I'm using:

 <?php if(Mage::registry('current_product')): ?>
<?php $product = Mage::registry('current_product'); ?>
<title>Laptop <?php echo ($product->getName()); ?></title>
<meta name="description" content="" />
<meta name="keywords" content="" />
<meta property="og:title" content="<?php echo ($product->getName()); ?>" />
<meta property="og:type" content="product" />
<meta property="og:image" content="<?php echo $this->helper('catalog/image')->init($product, 'small_image')->resize(200,200);?>" />
<meta property="og:url" content="<?php echo Mage::registry('product')->getProductUrl(); ?>" />
<meta property="og:description" content="<?php echo strip_tags(($product->getShortDescription())); ?>" />
<meta property="og:site_name" content="<?php echo Mage::app()->getStore()->getName(); ?>" />

I'm trying to get my custom atribute value on product view page.


texts: anchor tag define for specific image in slider ? magento2

texts:
I have purchased a theme from magento2 marketplace , i have a code for images slider on my homepage , i wants to a define an anchor tag for one specific image like this  ... so that i open a link on click of that image inside slider code , here's theme code looks like for slider :

 <?php $img= $_helperImage->init($_image['file'])->resize($width,$height); ?>
 <img
        <?php if($_parameters['lazyLoad'] && $i!=0): ?>
            src="<?php echo $img ?>" class="owl-lazy" data-src='<?php echo $_helperImage->init($_image['file'])->resize($width,$height); ?>'
        <?php else: ?>
            src='<?php echo $img; ?>'
        <?php endif; ?>

         <?php if ($_parameters['controlNavThumbs']): ?> data-hash="<?php echo $classid.$key ?>" <?php endif; ?> alt="<?php echo $_image['link'] ?>" title="<?php echo $_image['link'] ?>"

          />

and that's the location path of my specific image in which i want to define anchor tag :

echo $_helperImage->init($_firstImage['file']).'codazon/slideshow/cache/590x460/w/e/web_banner_11_a.png';

can anyone guide me please for making this condition , thanks!

EDITED : Following condition anchor tag is applying on all images:

 <?php $img = $_helperImage->init($_image['file'])->resize($width,$height); ?>
                            <?php $url = "https://127.0.0.1/site/pub/media/codazon/slideshow/cache/590x460/w/e/web_banner_11_a.png"; ?>
                            <?php if($url): ?>
                                <a target=”_blank” href="<?php echo "fb.com"; ?>">
                <?php endif; ?>
                            <img
                                <?php if($_parameters['lazyLoad'] && $i!=0): ?>
                                    src="<?php echo $img ?>" class="owl-lazy" data-src='<?php echo $_helperImage->init($_image['file'])->resize($width,$height); ?>'
                                <?php else: ?>
                                    src='<?php echo $img; ?>'
                                <?php endif; ?>
                                <?php if ($_parameters['controlNavThumbs']): ?> data-hash="<?php echo $classid.$key ?>" <?php endif; ?> alt="<?php echo $_image['link'] ?>" title="<?php echo $_image['link'] ?>"
                            />
                            <?php if($url): ?>

<?php endif; ?>


texts: $_SERVER['DOCUMENT_ROOT'] path issue in magento

texts:
Whats the right way of giving $_SERVER['DOCUMENT_ROOT'] path.

UPDATED:

Ie) In my app\design\frontend\base\default\template\folder\index.php i need to call other config files which is in document root of magento.

  <?php
    // Show only compile error
    error_reporting(E_COMPILE_ERROR );
    // check if pdo library enabled ?
    require_once($_SERVER['DOCUMENT_ROOT'] . '/magento/test/ajax_table.class.php');
    $obj = new ajax_table();
    $records = $obj->getRecords();
  ?>
<!DOCTYPE html>
<html>
 <head>
   <script>
        ...
   </script>
 </head>
</html>

var\www\html\magento\test\ajax_table.class.php

require_once($_SERVER['DOCUMENT_ROOT'] . '/magento/test/config.php');
class ajax_table {
..
 }

If i include the above:

<?php
// Show only compile error
error_reporting(E_COMPILE_ERROR );
// check if pdo library enabled ?
require_once('/test/ajax_table.class.php');
$obj = new ajax_table();
$records = $obj->getRecords();
?>

UPDATED:

Also path mismatch here:

\magento\skin\frontend\rwd\default\js\test\script.js

ajax = function (params,action){
$.ajax({
    type: "POST",
    url: "ajax.php",    //ajax.php is in var\www\html\magento\test\ajax.php
    data : params+"&action="+action,
    dataType: "json",
    success: function(response){
    ...}

I get blank screen with controller error...

Table insertion/ other operation is happening if i keep my index.php in same var\www\html\magento\test folder.

Its path issue.

The file seems to get called when i echo inside it, but functionality is not as expected, which works if i keep index.php too in the root folder, but i want it in design folder


texts: how to attach product ID with Product Image

texts:
I want to add 'ID' attribute with product_id value.

My code  is

$_images = Mage::getModel('catalog/product')->load($product->getId())->getMediaGalleryImages();
$count_image = count($_images);
$i = 1;

foreach($_images as $_image){

        if($_image->getDisabled()==1){
            $imageData = Mage::helper('catalog/image')->init($product, 'thumbnail', $_image->getFile())->resize(80,95);
            $content_images .= "
";
            break;
        }
        else {
            if($i==$count_image){
                $imageData = Mage::helper('catalog/image')->init($product, 'thumbnail', $_image->getFile())->resize(80,95);
                $content_images .= "
";

                }
        }
         $i++;

        }
    }

How can I add Product ID as ID in Image tag in LI


texts: How to prevent autogenerated category and product rewrite urls

texts:
When I'm importing products or creating categories Magento always automatically generates rewrite urls.

These rewrites are listed at Admin Backend -> Marketing -> URL Rewrites.

The category url I want:

www.example.com/store-view/category-name

What Magento 2 gives me after its autogenerated url rewrite:

www.example.com/store-view/catalog/category/view/s/category-name/id/4/

I know that I can get rid of the redirect by deleting it at Admin Backend -> Marketing -> URL Rewrites. However, I have hundreds of categories and thousands of products and there is no batch delete and I don't want to edit the database because this is unsafe and I would have to do it after each product import.

My questions are:
1. Why is Magento generating such wired urls?
2. How can I prevent autogenerated rewrite urls? Can I do this via config.xml or by writing a plugin (At this point of time I don't know the method that is responsible for autogenerating rewrite urls)?


texts: System Config Upload File Input Disabled

texts:
Here is the content of the system.xml file:
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
    <system>

            <![CDATA[Product Page Stock Location]]>
            <tab>catalog</tab>
            <resource>Develodesign_General::general</resource>
            <group id="company_flag" translate="label" type="text" sortOrder="6" showInDefault="1" showInWebsite="1">
                Company Display Settings
                <field id="custom_message" translate="label" type="Magento\Config\Block\System\Config\Form\Field\File" sortOrder="1" showInDefault="1" showInWebsite="1" >
                    Identifier, SKU and Custom Message CSV Mapper
                    <backend_model>Develodesign\General\Model\Config\Backend\FileUploader</backend_model>
                    <upload_dir config="system/filesystem/media" scope_info="1">catalog/custom_message</upload_dir>
                    <comment>CSV Header must be set to Company Id, Product SKU, and Custom Message.</comment>
                </field>

                <field id="employee_mapper" translate="label" type="Magento\Config\Block\System\Config\Form\Field\File" sortOrder="3" showInDefault="1" showInWebsite="1" >
                    Employee Name, Sole Code and Boot Code CSV Mapper
                    <backend_model>Develodesign\General\Model\Config\Backend\FileUploader</backend_model>
                    <upload_dir config="system/filesystem/media" scope_info="1">catalog/company_employee</upload_dir>
                    <comment>CSV Header must be set to Employee Name,Sole Code and Boot Code. Allowed file types: csv, xls,text/csv</comment>
                </field>
                <field id="product_sku" translate="label" type="text" sortOrder="2" showInDefault="1" showInWebsite="1" showInStore="4">
                    Product SKU
                    <validate>required-entry</validate>
                </field>
            </group>

    </system>
</config>

I am using a custom class ....\General\Model\Config\Backend\FileUploader that extends magento Magento\Config\Model\Config\Backend\File Here is the file input greyed out in the admin frontend. Inspecting the element I can see a class 'disabled' being added to the input, removing this class sure fixes the issue, of course, I can add a js file to remove the attribute on document ready, however, I am more interested in why its disabled in the first place.


texts: Magento - Custom Delivery Price with respect to Place and Amount

texts:
I am a newbie in Magento. I am using Magento 1.7.

My Client want me to add different Delivery Prices according to the Country, Amount and Weight.
This is what he wants.

1. STANDARD DELIVERY in UK is £7,
2. FREE DELIVERY in UK orders above £100,
3. EUROPEAN COUNTRIES is £10 for items below 5kg
4. REST OF THE WORLD IS is £19.99
5. System automatically add £5 per 5kg in UK
6. £15 per 5kg in rest of the world

Is there any modules that help me to add different options like these?
Or did I want to create a new module?


texts: Magento white page at backend and frontend

texts:
After customizing some files last week, both the backend and frontend of the site I’m developing for went blank. I have already searched the internet and tried out some possible solutions, but none of them works.

Somehow I can’t manage to show any error message. I already uncommented ini_set(’display_errors’, 1);, changed error_reporting(E_ALL | E_STRICT); into error_reporting(E_ALL); and I tried even more possible solutions.
I also edited the memory to 128M, changed some settings in php.ini, changed local.xml.sample to local.xml. Nothing seems to work..

I seriously have no idea how I can solve this, so that’s why I’m here. I hope someone can help me. If you need more information, please ask, I don’t really know what’s necessary to answer my question.

After adding the following lines to index.php I managed to get error messages:

error_reporting(E_ALL);
ini_set(’display_errors’, 1);
ini_set(‘memory_limit’, ’256M’);

The error I get is:

Cannot send headers; headers already sent in /home/cheapas/public_html/index.php, line 39

Trace:

#0 /home/cheapas/public_html/lib/Zend/Controller/Response/Abstract.php(115): Zend_Controller_Response_Abstract->canSendHeaders(true)
#1 /home/cheapas/public_html/app/code/core/Mage/Core/Model/App.php(1246): Zend_Controller_Response_Abstract->setHeader(’Content-Type’, ‘text/html; char...’)
#2 /home/cheapas/public_html/app/code/core/Mage/Core/Controller/Varien/Front.php(80): Mage_Core_Model_App->getResponse()
#3 /home/cheapas/public_html/app/code/core/Mage/Core/Model/Url/Rewrite.php(204): Mage_Core_Controller_Varien_Front->getResponse()
#4 /home/cheapas/public_html/app/code/core/Mage/Core/Controller/Varien/Front.php(166): Mage_Core_Model_Url_Rewrite->rewrite()
#5 /home/cheapas/public_html/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#6 /home/cheapas/public_html/app/Mage.php(683): Mage_Core_Model_App->run(Array)
#7 /home/cheapas/public_html/index.php(91): Mage::run(’’, ‘store’)
#8 {main}

Guess what, line 39 is: ini_set(‘memory_limit’, ’256M’);

When I delete this line I get a blank page again, so that doesn’t solve anything. Does anyone have an idea on solving this? Thanks!

As you may have understood, I actually can get error messages to show when I force an error by adding an unknown or uncomplete line to my index.php. Somehow there is a problem which doesn’t want to show up.


texts: Magento Authorize.net CIM integration issue with completion of order

texts:
I am attempting to set up Authorize.net's CIM payment method to work within Magento Community Edition, version 1.7.0.1. Since it is handled quite differently than the DPM and AIM methods, I have built it into the existing Onepage Checkout using an iFrame. I then pass it all the needed information, it works perfectly and Authorize.net completes the transaction and returns to the site.

Here is where the issue lies. I am not sure how to complete the order, and pass the confirmation to the database. What page would I send Authorize.net to for the return? I tried using /checkout/onepage/savePayment but it results in the following error:

  "{"error":"The requested Payment Method is not
  available.","message":"Invalid data."}"

Does anyone know how I might accomplish this?


texts:
I have just set up https on my store and it's active when I visit the customer login and checkout pages. Is it important to make other pages on my site use https// such as the homepage and product/cateogory pages? Right now the site directs to the ordinary www. instead of https// on those pages.

Thanks as always. :)


texts: Class Magento\Framework\Session\SaveHandler Not working

texts:
After fresh installation of 2.2.0 version it gives:

  Class Magento\Framework\Session\SaveHandler contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (SessionHandlerInterface:: ) in     vendor\magento\framework\Session\SaveHandler.php on line 16


texts: After join, use the result join again in Magento2

texts:
For example, I create a table which has product sku, I use the table LEFT JOIN `catalog_product_entity` table to get the entity_id, then want to use the entity_id result to LEFT JOIN `catalog_product_entity_media_gallery_value_to_entity` table to get the product gallery value_id.

I write the function like below:

protected function _initSelect()
{
    parent::_initSelect();

    $this->getSelect()->joinLeft(
        ['secondTable' => $this->getTable('catalog_product_entity')],
        'main_table.sku = secondTable.sku',
        ['entity_id']
    )->joinLeft(
        ['thirdTable' => $this->getTable('catalog_product_entity_media_gallery_value_to_entity')],
        'main_table.entity_id = thirdTable.entity_id',
        ['value_id']
    );
}

But, it doesn't work, it shows warning like below:

  SQLSTATE[42S22]: Column not found: 1054 Unknown column 'main_table.entity_id' in 'on clause', query was: SELECT COUNT(*) FROM `my_table` AS `main_table` LEFT JOIN `catalog_product_entity` AS `secondTable` ON main_table.sku = secondTable.sku LEFT JOIN `catalog_product_entity_media_gallery_value_to_entity` AS `thirdTable` ON main_table.entity_id = thirdTable.entity_id

So, how to achieve after join, use the result join again in Magento2?


texts: Magento 2: Set category image programmatically

texts:
How to set category image programmatically, which shows on list page? I found several solutions on the web but could not solve my problem. I am confused among these functions setThumbnail(), setImage(), setCategoryImage(). I tried all the functions but none of them solved my problem. I will be very thankful if anybody could provide me a code snippet to set category image (and directory where to place that image).

I uploaded the screenshot of adminpanel so that you guys can understand where i want to upload that image.

My code:

try{
    $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
    $category = $objectManager->get(\Magento\Catalog\Model\CategoryFactory::class);
    $collection = $category->create()->getCollection()->addAttributeToFilter('name','networking equipment memory')->setPageSize(1);

    if ($collection->getSize()) {
        $categoryobj = $collection->getFirstItem();
        $mediaAttribute = array ('image', 'small_image', 'thumbnail');
        $categoryobj->setImage('/test.jpg', $mediaAttribute, true, false)->save();
    }
} catch(Exception $e){
    echo $e;
}


texts:
I would like to create a custom module. I have taken the following setps my code are below.

app\code\local\Amzad\OrderComment\etc\config.xml

<models>
  <ordercomment>
    <class>Amzad_OrderComment_Model</class>
  </ordercomment>
    <ordercomment_resource>
        <class>Amzad_OrderComment_Model_Resource</class>
        <entities>
            <config>

ordercomment_config

            </config>
        </entities>
    </ordercomment_resource>
</models>

app\code\local\Amzad\OrderComment\Model\Resource\Config\Collection.php

   class Amzad_OrderComment_Model_Resource_Config_Collection extends Mage_Core_Model_Resource_Db_Collection_Abstract {
        protected function _construct()
        {
            $this->_init('ordercomment/config');
        }
    }

app\code\local\Amzad\OrderComment\Model\Resource\Config.php

    class Amzad_OrderComment_Model_Resource_Config extends Mage_Core_Model_Resource_Db_Abstract
    {
        protected function _construct()
        {
            $this->_init('ordercomment/config', 'id');
        }
    }

app\code\local\Amzad\OrderComment\Model\Config.php

    class Amzad_OrderComment_Model_Config extends Mage_Core_Model_Abstract
    {

        protected function _construct()
        {
            $this->_init('ordercomment/config');
        }
    }

Following 2 lines does not give me any output.

  $collection = Mage::getModel('ordercomment/config')->getCollection();
  echo "\n" . (string)$collection->getSelect()->limit(1);

php_error.log

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

Could someone help me resolve this issue.


texts: Adding messaging to cart based on Brand and Ship-to State

texts:
I am not very proficient at PHP and I am faced with a situation where if a specific brand is shipping to a specific state a message need to appear at the first stage of checkout. I am working in Theme/app/design/frontend/onecall/default/template/checkout and I have been successful at pulling back the brand, but not the 'region_id'

I am using this to call in the manufacturer

<?php
$cartItems = Mage::getSingleton('checkout/session')
          ->getQuote()
          ->getAllItems();
    foreach ($cartItems as $item) {
        $brand = Mage::getModel('catalog/product')->load($item->getProduct()->getId())->getAttributeText('manufacturer');
        echo $ean;
    }
    ?>

Any help would be greatly appreciated!


texts:
I need to delete my custom table data, I tried below code, but its not works for me.

my table:

test_id  product_id  testing

1           15       12345

my code:

    try{
        $model = $this->zipcodeFactory->create();

        $modelcollection = $this->zipcodeFactory->create()->getCollection();

        foreach($modelcollection as  $modeldata){

            $model->load($modeldata['test_id']);
            $model->delete();
        }

    }catch (Exception $e){

    }

Suggest Me What i Miss in this code.


texts:
Is there any built in method in Magento 2 I can use to get scheduled cron job by name from cron_scheduler table? I want to check before adding cron job if there already exists pending(scheduled to run) cron job.

Why I need to be sure: I need to send order data to third part app. I am afraid to send it straight when user makes the order because the possibility of processing error. Also i do not know the state of that app. Second place where i need it is when I need to check that admin does not schedule too many cronjobs when he/she pushes the button in admin area.


texts: Layout xml: Error in the page layout tag, how to analyse?

texts:
Whats wrong in the xml declaration below:

m_index_index.xml

<?xml version="1.0"?>
<page layout ="2columns-left" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
   <referenceContainer name="content">
        <block class="Magento\Catalog\Block\Product\ListProduct" name="product_list" template="Magento_Catalog::product/list.phtml">
            <block class="Magento\Framework\View\Element\RendererList" name="category.product.type.details.renderers" as="details.renderers">
                <block class="Magento\Framework\View\Element\Template" as="default"/>
            </block>
            <block class="Magento\Catalog\Block\Product\ProductList\Toolbar" before="-" name="product_list_toolbar" template="Vendor_Catalog::product/list/toolbar.phtml">
                <block class="Magento\Theme\Block\Html\Pager" name="product_list_toolbar_pager"/>
             </block>
             <action method="setToolbarBlockName">
                 <argument name="name" xsi:type="string">product_list_toolbar</argument>
             </action>
        </block>
    </referenceContainer>
</body>
</page>

I get:

  Cache file with merged layout:
  LAYOUT_frontend_STORE1_2d41d8cd98f00b204e9800998ecf8427e and handles :
  Please correct the XML data and try again.  [] []

  Cache file with merged layout:
  LAYOUT_frontend_STORE1_20834ceea6c85aca7db01929fe5d8ddb0 and handles
  default, m_index_index: Please correct the XML data and try again.  []
  []

  Cache file with merged layout:
  LAYOUT_frontend_STORE1_2a7ccd8094436548b564a588f6303121c and handles
  2columns-left: Please correct the XML data and try again.  [] []

I tried to give the layout as 3column.

Changed the file to default.xml

For "STORE1_2d41d8cd98f00b204e9800998ecf8427e and handles :" sometimes, doesnt specify which XML, need suggestions to debug this issue

But none helped.


texts: Connection refused error in command line Magento installation 2.4.1?

texts:
Magento removed web installation in 2.4.1 version, while installing from command line, I am getting below error:
 bin/magento setup:install --base-url=http://dev.magento.local/ --db-host=127.0.0.1:3307  --db-name=magento24 --db-user=root --db-password=Admin@123 --admin-firstname=admin --admin-lastname=admin --admin-email=admin@admin.com --admin-user=admin --admin-password=admin123 --language=en_US --currency=USD --timezone=America/Chicago --use-rewrites=1 --search-engine=elasticsearch7 --elasticsearch-host=es-host.example.com --elasticsearch-port=9200

SQLSTATE[HY000] [2002] Connection refused

In InstallCommand.php line 274:

  Parameter validation failed

Update:
I managed to fix this . Please note the single quote in password
bin/magento setup:install --base-url=http://dev.magento.local/
--db-host='127.0.0.1'  --db-name=magento24 --db-user=root
--db-password='Admin@123$$'


texts: How to show time in my text box also current month date i can't able to select

texts:
In backend i added date and time

<script type="text/javascript">
    // <![CDATA[
    Calendar.setup({
    inputField : 'shipping_pickup_at_store_date',
    ifFormat : '%d-%m-%Y',
    showsTime: false,
    button : 'shipping_pickup_at_store_date',
    singleClick : true,
    disableFunc: function(date) {
    //disable previous day in datepicker
        var now= new Date();
        if(date.getFullYear()<now.getFullYear())
        {
            return true;
        }
        if(date.getFullYear()==now.getFullYear())
        {
            if(date.getMonth()<now.getMonth())
            {
                return true;
            }
        }
        if(date.getMonth()==now.getMonth())
            {
            if(date.getDate()<now.getDate())
            {
                return true;
            }
        }
    },
    });
    // ]]>
</script>

in DataPicker it shows date and time if i select in my textbox it will show only data how i show time

Also I can't able to choose current month date


texts:
I have the following code.

        $collection = Mage::getModel('catalog/product')->getCollection();
        $collection->addAttributeToSelect(array('featuredcategory','featured', 'price','name','small_image','frontend_name'));
        $collection->addFieldToFilter('type_id', 'configurable');

This takes about 5 secs. But when I comment the last line i.e.

//$collection->addFieldToFilter('type_id', 'configurable');

it takes less than 1.5 secs.

I have flat catalog enabled.

Question: Is there anything wrong with this collection?

I use Magento 1.6


texts: someone hacked us, I deleted that user acc. & created a new one but now missing most menus in Admin

texts:
Magento 1.9.1
Porto theme

Someone hacked our Magento, deleted all user accounts and created one for themselves with a user ID = shopmanager1. I connected via cPanel's phpmyAdmin, deleted their user account, created a new user account, assigned it Admin priviliges. It now let's me login into Admin but most menus are missing (we only have Catalog, CMS and a little bit of SYSTEM - mostly extensions I installed). How can I get all the other menus back? How did this happen in the first place?


texts:
After installing Magento 2.3, When I am trying to open the admin panel login screen is blank and my console contains an error as shown in the image. if anyone has a solution then please let me know.

magento 2 how to print log???


texts: Magento Password Field is missing when installing magento

texts: Almost I've been install magento 5 to 10 times on my localhost server. but there is no option to insert admin username and admin password. my question is where is the admin username and password fields?, when installing magento username and password.


texts: Magento 2 - Column tier_price is set NULL in catalog_product_index_price table

texts:
I tried to populate column tier_price of catalog_product_index_price table but every time that reindex this column return NULL.

Why tier_price column return NULL every time i reindex magento 2?
Thanks


texts:
I Would like to Change the actual theme of My shop.
Before i ask for offers i Would like to know how much work it is - especially because all Settings, 3rd Part extensions (one stepp checkout, Gift extension and so on) all
Need to maintained.

How long a Developer Would need to do it?


texts:
I created a new Magento 2 module and followed the injection-based logger object creation.

protected $logger;
public function __construct(\Psr\Log\LoggerInterface $logger)

  Now, when I log using this logger, I get it logged as module main.
  e.g.

  [2019-08-22 10:42:02] main.INFO: message ...

I presume, the main is the root logger.  How can I create my logger, so that instead of main, it will print my module name every time?

This is pretty standard practice in java to create a logger for the given class or package so that you can control the logging levels per package.  I don't even want to control the level, at least this will help me grep for my messages in my log.  How can I achieve this?


texts: Change product position programmatically

texts:
I'm using a magento api script to change the product status.
i want to add to the script an update that will change all the positions of the product in all of the related categories to 0.
what would be the best approach for this:

This is the script that i'm using in a nutshell

require_once 'app/Mage.php';
Mage::app('default');
Mage::app ()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
umask(0);
$sku = $_GET['sku'];
$id = Mage::getModel('catalog/product')->getIdBySku($sku);
$product = Mage::getModel('catalog/product')->load($id);
Mage::getModel('catalog/product_status')->updateProductStatus($product->getId(), 0, Mage_Catalog_Model_Product_Status::STATUS_ENABLED);

Thanks.


texts: Adding Google Tag manager  tag after body tag

texts: I need to place noscript tag of gtm just after closing body tag.


texts: setStatus(1) for Store ID 1 but use setStatus(2) as default

texts:
We have an importer were the products should be disabled by default, but enabled for just one specific store ID.

I use the following:

Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);          $product->setVisibility(Mage_Catalog_Model_Product_Visibility::VISIBILITY_NOT_VISIBLE);             $product->setStatus(Mage_Catalog_Model_Product_Status::STATUS_DISABLED);
$product->setWebsiteIds(array($this->magentoWebsiteId));
$product->setStoreId($this->getMagentoStoreId());
$product->setStatus(Mage_Catalog_Model_Product_Status::STATUS_ENABLED);

However, the products are are not disabled in "default". How can I disable the product by default for every store, but not for one specific?


texts: Why are these files not being loaded in the product page of Magento? (M1.9.3.8)

texts:
Does anyone know why this is not being rendered (saved in the local.xml of my custom theme)?

The location of the local.xml is app/design/frontend/mobile/XX/layout/local.xml

and the content is

<catalog_product_view>
    <reference name="body">
        <action method="addJs"><script>varien/product.js</script></action>
        <action method="addJs"><script>varien/product_options.js</script></action>
    </reference>
</catalog_product_view>

The location of the js files is ./js/varien/

Thanks for your tips on that.


texts: List newest products on top, when sorting by attribute

texts:
I'm sorting my products by an attribute which tells if the products are "regular catalog products" or "order selection". In this way all the regular displays first, then all the ones from the order selection.
However; the products displays "old to new" within these two sections.

Is it possible to force the products to display "new to old" within these two attribute values instead?

I'm using Magento CE 1.9.2.4

UPDATE 15/11-16: The solution from @arunendra in this post (Newly added products not showing as first in category) partly solves this, however it only work when product listings is one page. When multiple pages in prodict listing, the attribute I sort by is randomly.


texts:
class Mage_Customer_Model_Designs file

function _construct()
{
  $this->_init('customer_designs/customer');
}

class Mage_Customer_Model_Resource_Designs file

protected function _construct()
{
  $this->_init('customer_designs/customer','d_id');
}

class Mage_Customer_Model_Resource_Designs_Collection file

protected function _construct()
{
  $this->_init('customer_designs/customer');
}

class Mage_Customer_Block_Account_Dashboard_Designs file

function get_my_designs()
{
 return $collection = Mage::getModel('customer/designs')->getCollection();
}

Table Name: customer_designs, Table Prefix: djc

These are all my codes. My Blog file returns bool(false).  I just replaced existing code. I don't know how these codes are all codes working. Kindly help me to get out of this issue.


texts: After selecting a shipping method and entering CC info I get this message (Shipping method has not been selected yet).  This started happening out of the blue.  Sometimes instead of getting that message I get a message asking for CC number again.  Losing business.  Please help.


texts: Force order status and state to processing after creating shipment using observer

texts:
I created an observer to change my order status after creating shipment like this:

events.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="sales_order_shipment_save_after">
        <observer instance="Namespace\Module\Observer\Sales\OrderShipmentSaveAfter" name="namespace_module_observer_sales_ordershipmentsaveafter_sales_order_shipment_save_after"/>
    </event>
</config>

app/code/Namespace/Module/Observer/Sales/OrderShipmentSaveAfter.php

public function execute(
    \Magento\Framework\Event\Observer $observer
) {
  $shipment = $observer->getEvent()->getShipment();
  $order = $shipment->getOrder();
  $orderState = Order::STATE_PROCESSING;
  $status = 'delivery';
  $order->setState($orderState)->setStatus($status);
  $order->save();
}

If i create an order then create a shipment the status will be delivery, and the state will be processing, but if i create invoice first then create shipment for my order, the order status and state will become complete and


texts: Two store views in DB, use only 1 store view

texts:
In our DB we find two store views with id 0 and id 1.
But in the backend we only have 1 store view and we also use only 1 store view, with id 0.

Is this right or are we missing something?


texts: what is "they found a typo in the CMS block",I got a question in a magento 2 practice test, Can any one clarify this?

texts:
You have written a free module that is distributed on GitHub. Unfortunately, people are reporting that they found a typo in the CMS block.

How do you get this resolved?

Answers( radio button type)

-> Tell users to update the content.

-> Switch to hard coding the value into your module and release an update.

-> Create a new data patch.

-> Fix the content in your module's UpgradeData class.

What is the meaning of " they found a typo in the CMS block".

Since this is a magento forum , i hope this question is eligible to ask and get support from the expert.Please some one explain.


texts: magento 2 catalog:images:resize - Notice error

texts:
I have strange error in magento when trying to regenerate thumbs:

$ php bin/magento catalog:images:resize

  Notice: Undefined index: Magento\Catalog\Model\Product in
  /Applications/MAMP/htdocs/mini-minicart-mobile/vendor/magento/framework/Interception/PluginList/PluginList.php
  on line 232

What is wrong?


texts: how to add HTML Invoice print button in Magento 2

texts:
I want to add a custom Print button on the invoice view page and print the different invoice according to order type from the default invoice.
I have to override Magento\Sales\Block\Adminhtml\Order\Invoice\View Class to add a custom button. But when I am clicking this button my controller is not working


texts: Add or edit addresses during multishipping steps in page?

texts: Is there a way to add the ability to edit or add a shipping address in the multishipping checkout process similar to how many onepage checkout extensions do it (example: http://www.magentocommerce.com/magen...-checkout.html). I have placed some form elements in the correct pages, but I'm not sure how best to proceed. Any help would be greatly appreciated! Screenshots included;


texts: Magento2: for several days Very slow website loading

texts:
I have a dedicated server and two different stores on this server. One store loading perfectly, but with the second store for several days I have a problem with website loading - is too long.

I do not know what it is caused. There is clearly a problem with the magento application, can anyone help us?

czasowewyprzedaze.pl

[2018-08-20 04:24:50] main.CRITICAL: Unable to resolve the source file for 'frontend/Mgs/claue/pl_PL/priceBox.js' [] []
[2018-08-20 04:25:08] main.CRITICAL: Unable to resolve the source file for 'frontend/Mgs/claue/pl_PL/jquery/ui.js' [] []
[2018-08-20 04:25:23] main.CRITICAL: Unable to resolve the source file for 'frontend/Mgs/claue/pl_PL/zoom-images.js' [] []
2018-08-20 04:25:47] main.CRITICAL: Unable to resolve the source file for 'frontend/Mgs/claue/pl_PL/mgs/owlcarousel.js' [] []
[2018-08-20 04:26:11] main.CRITICAL: Unable to resolve the source file for 'frontend/Mgs/claue/pl_PL/mgs/lazyload.js' [] []
[2018-08-20 04:26:31] main.CRITICAL: Unable to resolve the source file for 'frontend/Mgs/claue/pl_PL/magnificPopup.js' [] []
[2018-08-20 04:26:46] main.CRITICAL: Unable to resolve the source file for 'frontend/Mgs/claue/pl_PL/waypoints.js' [] []
[2018-08-20 04:27:14] main.CRITICAL: Unable to resolve the source file for 'frontend/Mgs/claue/pl_PL/jquery/jquery-storageapi.js' [] []

[2018-08-20 04:25:08] main.CRITICAL: Unable to resolve the source file for 'frontend/Mgs/claue/pl_PL/jquery/ui.js' [] []
[2018-08-20 04:25:47] main.CRITICAL: Unable to resolve the source file for 'frontend/Mgs/claue/pl_PL/mgs/owlcarousel.js' [] []


texts: Magento 2: upgrade to 2.1.6 resulted product images not working

texts:
I upgraded Magento 2.1.5 to 2.1.6 and after upgrade the product images in frontend's product list pages stopped working. Inspect says the following for all the products:

GET /pub/media/catalog/product/cache/f073062f50e48eb0f0998593e568d857/t/r/image.jpg 404 (Not Found)

Tried to clear and disable cache. I also re-deployed static content. Also set the owner of pub/media to be apache user.

Also worth noting that images at product pages work without a problem. The problem is at the product list page.


texts: Currency switcher not working for currency AED in Magento 2

texts:
I have created a multi-currency website.
What I did to change Default USD to AED
1. Base Currency change to UAE Dirham
2. Default Display Currency set to UAE Dirham
3. Allowed Currencies also.
4. Currency Symbol set to AED.

The product price shows properly in AED and if i change to any other currency then switcher working properly.

expected result

Magento ver. 2.2.3


texts: magento 1.9 : anchor tag not working in language translation

texts:
I want to place anchor tag in given text>so i kept like this

   <?php    $var=Mage::getBaseUrl();
   echo $this->__("Iam here with link",$var) ?>

I wrote translations for

      Iam here with link in csv file but it is not translating


texts:
How can I completely disable the customer dashboard after login and after customer registration ?

After that I want to write only a success message.

Thanks for help.


texts: Use quote in csv module translation file

texts:
I'm trying to translate a module strings, and use a quote in the translated text, tried this

"If the quote is approuved, simply click to ""proceed to checkout"" and follow steps online to confirm your order.","Si la soumission est approuvée, cliquez simplement sur ""accepter la soumission"" et suivez les étapes en ligne afin de confirmer votre commande."

But in the html email i got this

If the quote is approuved, simply click to ""proceed to checkout"

I tried to use

"Note: If you have a credit account established with us, you will have the choice to &quot;charge to the account&quot; during the payment step.","Note: Si vous avez un compte crédit d'établi avec nous, vous aurez le choix &quot;porter au compte&quot; lors de l'étape du paiement."

But, i got the quot; in the email message


texts:
I'm fairly new in Magento and trying to override a phtml file which is originally in

app/design/frontend/rwd/default/template/catalog/product/view/type/availability/default.phtml

with custom one that I ve created in

app/design/frontend/base/default/template/Pawel/productsub/catalog/product/view/type/availability/default.phtml

In my app/code/local/Pawel/Productsub/etc/config.xml
I ve put this:

<config>
...
       <frontend>
            <layout version="0.1.0">
                <PRODUCT_TYPE_simple translate="label" module="catalog">
                    <reference name="product.info">
                        <action method="setTemplate">
                            <template>catalog/product/view/type/availability/default.phtml</template>
                        </action>
                    </reference>
                </PRODUCT_TYPE_simple>
            </layout>
        </frontend>
    ...
    </config>

And this is the layout i'm trying to change app/design/frontend/rwd/default/layout/catalog.xml

 <PRODUCT_TYPE_simple translate="label" module="catalog">
        Catalog Product View (Simple)
        <reference name="product.info">
            <block type="catalog/product_view_type_simple" name="product.info.simple" as="product_type_data" template="catalog/product/view/type/default.phtml">
                <block type="core/text_list" name="product.info.simple.extra" as="product_type_data_extra" translate="label">
                    Product Extra Info
                </block>
            </block>
            <block type="catalog/product_view_type_simple" name="product.info.availability" as="product_type_availability" template="catalog/product/view/type/availability/default.phtml" />
        </reference>
    </PRODUCT_TYPE_simple>

I will appreciate if someone can help me out and explain a little what I'm doing wrong, it gets me a little nervous already.


texts: Magento2 - How to display mini cart scroll?

texts:
I want to display minicart scrollbar when there is more then 4 product in cart i tried to set it from

  Store-> Configuration -> Checkout -> Shopping Cart

Sidebar but it not work for me


texts: How to display a custom block above "product tags" block in product detail view page?

texts:
Magento 1.9.x

I've added some code to the catalog.xml file under catalog/product_view block and I can see my custom block appear in the product detail view page.
 However, it's displayed below the product tags block.

What do I have to do in order to get my block appear above the product tags block and not below?


texts:
Fairly new to Magento and still learning the inner workings. I've been given the task of importing Best Buy's large array of product catalog into our existing magento installation. However i dont know where to begin. Just looking for a roadmap of some sort.

Not sure if it'll be easier to import their data into our database or show products on the fly. Any advice or guidance or code sample will help.

Thanks


texts: Magento 1.x site gives me an error message about Fatal error

texts:
I get this when I go to my site:

Fatal error: Call to a member function children() on a non-object in app/code/core/Mage/Core/Model/Config.php on line 946

I have done anything on it today.

May I ask for direction?


texts: Problem with confirmation email for guest's order (Magento CE 1.9)

texts:
I found two problems with the email confirmation order made by a guest with Magento CE 1.9.

I receive the confirmation email only on one email account, even if I set it up on two email account
I don't see the VAT code on the email, even if I've made the VAT field as required, also for guest, and I've put this data on the email template using this code → {{var order.getData('customer_taxvat')}}

The really strange thing is that if it's a normal order, the correct email is sent to both of them and I see the VAT field.

If it's a guest's order the email is sent to only one email and the VAT field is empty (or null, I don't know).

Someone knows why?


texts: Magento2 Varnish configurations for mobile

texts:
I am using varnish with magento2. however by default  VCL doesn’t include device detection and assumes that websites are responsive so that the mobile and desktop browser would be served the same page.
How do I change varnish config so that it saves cache based on user-agent?


texts: Dealing with more than 100k categories in Magento 2

texts:
In shop that i'm developing I need to deal with more than 100k categories.
The problem is with displaying them in adminpanel especially in sites: "catalog/categories/index or edit" and "catalog/products/edit/". It took more than 4 GB of RAM when I opened these pages with memory_limit = -1

I would like to know why Magento takes that much RAM in admin panel if in storefront it lasts only few seconds to load all categories. Even if I remove category tree and all other blocks for editing on site "catalog/categories/index or edit" it doesn't help and it still takes a lot of ram.

What is the best way to deal with such a large number of categories?


texts: How to get disabled products in Magento 2

texts: Is there a way to get disabled products programmatically in Magento 2 ?


texts:
Anybody please let me know how to define a "toOptionArray()" kind of function in Magento 2 such that any "array" (I have "array" formatted data not object[] format) can be defined and assigned to Admin custom form "select" field.

Like below:

public function getBannerEffects()
        {
                return array(
                array('value' => 'none', 'label'=>__('None')),
                        array('value' => 'blindX', 'label'=>__('Blind X')),
                        array('value' => 'blindY', 'label'=>__('Blind Y')),
                        array('value' => 'blindZ', 'label'=>__('Blind Z')),
                        array('value' => 'cover', 'label'=>__('Cover')),
                        array('value' => 'curtainX', 'label'=>__('Curtain X')),
                        array('value' => 'curtainY', 'label'=>__('Curtain Y')),
                        array('value' => 'fade', 'label'=>__('Fade')),
                        array('value' => 'fadeZoom', 'label'=>__('Fade Zoom')),
                        array('value' => 'growX', 'label'=>__('Grow X')),
                        array('value' => 'growY', 'label'=>__('Grow Y')),
                        array('value' => 'scrollUp', 'label'=>__('Scroll Up')),
                        array('value' => 'scrollDown', 'label'=>__('Scroll Down')),
                        array('value' => 'scrollLeft', 'label'=>__('Scroll Left')),
                        array('value' => 'scrollRight', 'label'=>__('Scroll Right')),
                        array('value' => 'scrollHorz', 'label'=>__('Scroll Horizontal')),
                        array('value' => 'scrollVert', 'label'=>__('Scroll Vertical')),
                        array('value' => 'shuffle', 'label'=>__('Shuffle')),
                        array('value' => 'toss', 'label'=>__('Toss')),
                        array('value' => 'turnUp', 'label'=>__('Turn Up')),
                        array('value' => 'turnDown', 'label'=>__('Turn Down')),
                        array('value' => 'turnLeft', 'label'=>__('Turn Left')),
                        array('value' => 'turnRight', 'label'=>__('Turn Right')),
                        array('value' => 'uncover', 'label'=>__('Uncover')),
                        array('value' => 'wipe', 'label'=>__('Wipe')),
                        array('value' => 'zoom', 'label'=>__('Zoom'))
                );
        }

Can this be declared in Model or Helper ?

How to assign this data to custom module Admin panel form "select" field ?


texts: Unable to start Express Checkout - checkout with paypal in shopping cart

texts:
We are having a problem with how PayPal Express Checkout is functioning.  We have the "Pay with PayPal" button showing on the shopping cart.  However,when a customer clicks it redirect to paypal page only customer is not logged in but if customer is already logged in then it keeps on cart page and throw error "Unable to start Express Checkout."

I done this change :
Enable SSL verification = 'No'
but still not working for logged-in customers only.


texts: How can i bulk ADD URL Rewrite Management

texts: How can i add bulk URL Rewrite Management, i need to migrate new website, but i have already promoted my old site products, so, after i change new site, old site url return blank page, or empty page. So i have add all my old site url into new site request path, my target path is my new site products url. so i have no problem after change my site.


texts:
I upgrade to 2.3.4 but the composer failed on one module.

After fixing this the developer site was missing the entire setup directory.
I have copied this from the production site but now I cannot get the developer site to work as both the dynamic and forced static deploy result in the developer mode missing files for example:

Warning: file_get_contents(http://dev.romatech.co.uk/static/version1588063551/frontend/RTech/neo/en_GB/RTech_Contentful/images/arrow.svg): failed to open stream

This looks like a failure to redirect.

I am using Nginx and have the .htaccess file in pub/static but no joy.

Can anybody help out with this?


texts: How tough is magento2 to understand compared to magento 1.9?

texts: Actually, I used Magento 1.9.1.1 .magento 2 is easily understand than Magento 1.9


texts:
Since I've upgraded to CE 1.8.1.0 I have been getting the following error message:
"Warning tax discount configuration might result in different discounts than a customer might expect . Please see source for more details.Click here to go to Tax configuration and change your settings."

When I attempt to go to my configuration I get a blank screen.

What happened?


texts: error trying to set production mode magento2.2

texts:
i have a magento 2.2.0 website and trying to change from developer mode to production mode gives me the below error

Command returned non-zero exit code: `/opt/remi/php70/root/usr/bin/php -f /home/stagesite.****.com/bin/magento setup:static-content:deploy -f en_US`

When I look at the var/log/system.log I see

  [UnexpectedValueException]
  Could not parse theme static file '/home/stagesite.*****.com/app/design/frontend/Smartwave/porto/Magento_Catalog-OG/web/js/jquery.zoom.min.js

This js file is not modified in anyway so not sure whats wrong with it or how to fix it?


texts: Magento2 import csv and delete existing value for column special_price

texts:
I use Magento CSV import/export functionality in order to import and export stocks and pricing regularly and it works perfectly.

But I do not how to remove an existing "special_price" by using the CSV file. If I pass "NULL", will the special price becomes 0?

Can anyone help me? Please!


texts: Magento: Limit Product Max Quantity Per Customer (NOT per Order)

texts:
I want to limit the product max qty per customer to only 1.

Example: If you buy the product my_product_per_customer as a registered customer you can not buy again with the same account.

Does anyone know a way to achieve this?

My config.xml is

  <?xml version="1.0" encoding="UTF-8"?>
<config>
<modules>
<Inchoo_MaxOrderAmount>
<version>0.0.2</version>
</Inchoo_MaxOrderAmount>
</modules>
    <frontend>
        <events>
            <sales_quote_save_before>
                <observers>
                    <inchoo_maxorderamount_enforceSingleOrderLimit>
                        <class>inchoo_maxorderamount/observer</class>
                        <method>enforceSingleOrderLimit</method>
                    </inchoo_maxorderamount_enforceSingleOrderLimit>
                </observers>
            </sales_quote_save_before>
        </events>
    </frontend>
</config>

My observer.php is

<?php
class Inchoo_MaxOrderAmount_Model_Observer
{
    private $_helper;
    public function __construct()
    {
        $this->_helper = Mage::helper('inchoo_maxorderamount');
    }
    /**
     * No single order can be placed over the amount of X
     */
    public function enforceSingleOrderLimit($observer)
    {
        if (!$this->_helper->isModuleEnabled()) {
            return;
        }
        echo 1; die;
        //todo - look up customer info and check if they already purchase this item
        $quote = $observer->getEvent()->getQuote();
        if ($quote->getCart()->getItemsCount() == 1) {

            Mage::getSingleton('checkout/session')->addError('limit only one product per order');
            Mage::app()->getFrontController()->getResponse()->setRedirect(Mage::getUrl('checkout/cart'));
            Mage::app()->getResponse()->sendResponse();
            exit;
        }
    }
}


texts: How to use Magento’s session within WordPress From Magento 2?

texts:
I have one wordpress setup like this
Wordpress Project Path :-

/var/www/html/wordpress/

And in that i set the my magento 2 setup like that

/var/www/html/wordpress/magento-2/

so i need to access the customer session from magento-2 setup to my WordPress setup
can any one idea regard that how can i do that


texts: Magento 2 prevent function from executing using plugins

texts:
There is a third party module which contain the RecurringData.php file.
That class has install function which runs $this->testimonial->update(); function. I want to stop the execution of that function. I don't want          $this->testimonial->update(); to execute.
public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
{
    $setup->startSetup();

     $this->testimonial->update();

    $setup->endSetup();
}

I am not sure which plugin would be the right fit for this.  how can I skip this function execution using plugin?
Any help would be appreciated!


texts: How to remove bundle options from product when loading the admin edit view?

texts:
I want to strip all bundle options from a bundle product when it loads except the first one. To give this some context, I have products with upwards of 20 options, each containing the same set of products. This means the form contains literally thousands of fields. I was working around it by increasing php max_input_vars but when that topped 10,000 and still failed saving one of the largest products I figured it was getting stupid.

At the moment, when saving a bundle product I've attached a function to the save handler which copies the first bundle option and applies it to the remaining option. I plan to add a number input field which specifies the number of bundle options instead of adding the options manually, but that's for another time.

The problem is, I don't know where to begin to find out where I can intercept the product loading and strip out the options I don't want. Obviously when the product has loaded I only want the UI to show one bundle option with the quantity field, not loads of identical bundle options.

To top that off, if you try to save a bundle product which has more than 20 options the table paginates. If you don't make any changes and try to save it throws an error. There's an issue about it on GitHub here: https://github.com/magento/magento2/issues/6916

So, which Controller file can I override so that when a Bundle product is loading I can remove all but one of the bundle options?


texts: Event observer for category tree changed

texts:
I'm searching an observer launched after a category was changed by user in category tree (parent change for example).

The event catalog_category_save_commit_after is not fired on this particular user action.

Does anybody know such an event exists ?

Thanks !

P.S. : I already double-check event generated list and could not find anything on this theme.


texts: Uninstall a module that is not a composer package?

texts:
Is there a way to discard/revert the changes I made with InstallData/UpgradeData scripts without having to go to database and revert changes there manually?

I know there is Uninstall.php, but it only works if your module is a composer package.


texts: Magento 2 - Server side vs client side compilation (Pros and Cons)?

texts:
What do I need to know to compare Server side and client side compilation mode on my Magento 2 store?
This config is on Store > Configuration > Advanced > Developer > Frontend Development Workflow.


texts: Magento 2 get Parent products id in admin create products

texts:
how to get Parent id of the child products magento 2 in create product admin?

Thanks


texts: How can you override Mage_Adminhtml_Permissions_UserController

texts:
Most of today I have been trying to override Mage controller and I have no ideas what I'm doing wrong. Does anyone can help me.

app/code/local/Fox/Extacl/etc/config.xml

<modules>
    <Fox_Extacl>
        <version>0.1.0</version>
    </Fox_Extacl>
</modules>
<global>
    <models>
        <admin>
            <rewrite>
                <session>Fox_Extacl_Model_Session</session>
            </rewrite>
        </admin>
    </models>
    <blocks>
        <adminhtml>
            <rewrite>
                <permissions_user_edit_tab_roles>Fox_Extacl_Block_Permissions</permissions_user_edit_tab_roles>
            </rewrite>
        </adminhtml>
    </blocks>
</global>
<admin>
    <routers>
        <adminhtml>
            <args>
                <modules>
                    <Fox_extacl before="Mage_Adminhtml">Fox_Extacl_Adminhtml</Fox_extacl>
                </modules>
            </args>
        </adminhtml>
    </routers>
</admin>

app/code/local/Fox/Extacl/controllers/Adminhtml/UserController.php

<?php
require_once('/app/code/core/Mage/Adminhtml/controllers/Permissions/UserController.php');
class Fox_Extacl_Adminhtml_UserController extends Mage_Adminhtml_Controller_Action
{

public function saveAction()
{
    if ($data = $this->getRequest()->getPost()) {
        echo '<pre>';
        print_r($data);

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

Thank you in advance.


texts:
I'm having a problem in using horizontal navigation. When I sort something, at I changes show products with ajax the navigation isn't functional anymore. The click function in jQuery is still working but removeClass and addClass isn't working anymore.

The click function in our jQuery (ajaxlist module):

jQuery(document).on("click", "#horizontal-layered-navigation-container div.horizontal-filter .filter-title", function(e) {
    e.preventDefault();
    _is_expanded = jQuery(this).hasClass("horizontal-filter-title-expanded");
    jQuery("#horizontal-layered-navigation-container div.horizontal-filter .filter-title.horizontal-filter-title-expanded, #horizontal-layered-navigation-container div.horizontal-filter .filter-content.horizontal-filter-content-expanded").removeClass('horizontal-filter-title-expanded horizontal-filter-content-expanded');
    if (!_is_expanded) {
        jQuery(this).next('div.filter-content').addClass('horizontal-filter-content-expanded');
        jQuery(this).addClass('horizontal-filter-title-expanded');
    }
    window._open_horizontal_dropdown = true;
});

Link when sorting works: /mand and after ajaxcall and sorting is broken /mand#brands=701,419,882

Hope some of you can figure out why the body of the if-statement suddenly isn't working :)


texts: updating the quantity is working only for one product

texts:
we have a marketplace site, where each seller/vendor have different accounts.
we are displaying products infromation in their account in frontend.
we want to provide a seller an option for editing the quantity
we are using this code : http://pastebin.com/RTYvpS0W to display the list of product name, sku , quantity.
we are using following code to edit the quantity

    <?php echo (int) Mage::getModel('cataloginventory/stock_item')->loadByProduct($products)->getQty(); ?>
    <input type="text" id="qty_<?php echo $product_id;?>" name="qty" value="<?php echo (int) Mage::getModel('cataloginventory/stock_item')->loadByProduct($products)->getQty(); ?>" style="display:none"/>

        <img onclick="updateField('<?php echo $product_id; ?>');return false;" src="<?php echo $this->getSkinUrl('marketplace/images/icon-edit.png'); ?>"/>

<?php $url = Mage::getUrl('module_name/index/updateField/'); ?>

but its working only for first product, please help me what code  have to replace to work it for all products


texts:
We are trying to create a custom layout of the customer login page,
baseURL/customer/account/login/
We have almost created a custom layout with the following syntax,
We are not able to integrate

Captcha on the registration page
Remember me on the login page

Here is our code
<?php echo $this->getLayout()->createBlock("Magento\Customer\Block\Form\Register")->setTemplate("My_CustomLogin::form/register.phtml")->toHtml();?>

<?php echo $this->getLayout()->createBlock("Magento\Customer\Block\Form\Login")->setTemplate("My_CustomLogin::form/login.phtml")->toHtml();?>

Please help us to achieve two missing concepts,
Thanks in advance,


texts: How can i make a custom product type configurable?

texts: I have made a custom product type but now I want to make it "configurable". Is there a way I can just add an attribute or something and it will be configurable?


texts: Install a custom module in magento 2 stable

texts: Downloaded the M2 from magentocommerce with sample data. I have custom module which i developed locally on M2-rc 2.0. My question is that now how can i install module and where i place the custom module as there is no code folder in app directory and all the magento modules are in vendor folder. Also i dont want to create a repo for my module. Also i want to put my module in vendor folder


texts: Checkout Custom Input field as required="required" does not mandate the the value to be entered

texts:
I have a custom Magento 2.2.6 module, the custom date picker filed under app/code/Vendor/DeliveryTime/view/frontend/web/template/container does not mandate the value to be entered as I have set the input with required="required". I can click Next in the checkout process without filling the Field.

            <input type="text" readonly="readonly" data-bind="mpdatepicker: true, value: deliveryDate"
                   name="delivery-date" id="mp-delivery-date" required="required" />


texts:
In magento 1.9.1 when I am trying to upgrade to 1.9.2 on live server, it is being failed. After failed attempt for upgrade, when I try to login on admin page, it is giving 500 internal server error. Even in var/log folder also, I can't find recent logs.

How to resolve this issue? Can anyone guide me to solve the error?


texts: Update dropdown attribute value Programtically for single product

texts:
Onclick Add to cart button we are trying to update the Attribute value from "NO" to "YES".

[ attribute code : cart_status (Yes/No dropdown) Attribute ]

I tried below code, its changing attribute values for all products, but i need to change value only for that particular product that i added to cart.

<?php

foreach ($collections as $key => $product)
{
    echo $product->getName().'

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

<form action="<?php

echo  Mage::helper('checkout/cart')->getAddUrl($product);

// update cart_status

    echo "\n".'updating '.$_product->getSku()."...\n";
    $_product->setData('cart_status', 1)->getResource()->saveAttribute($_product, 'cart_status');
    $_product->save();

// update cart_status end

?>" method="post">

<button>Add to cart</button>

</form>

Update

After following Dhiren Vasoya's Solution , once i click on Add to cart, In 1)Frontend its changing Attribute value [From "NO" to "YES" , but once i refresh page, again it showing old value [ NO ] , But in 2)In Backend, updated Values are not showing for "Default Values" , but showing for "Stores"

Default values :

Stores :

config :

<checkout_cart_product_add_after>
            <observers>
                <example_add_to_cart_after>
                  <class>Amasty_Example_Model_Observer</class>
                  <method>AddToCartAfter</method>
                </example_add_to_cart_after>
            </observers>
</checkout_cart_product_add_after>

app/code/local/Amasty/Example/Model/Observer.php

class Amasty_Example_Model_Observer
{
    public function AddToCartAfter($observer)
    {

         $product = $observer->getEvent()->getProduct();
         $product->setCartStatus(1);
         $product->save();
    }
}


texts: how to check customer logged in or not in cms block page in magento 2

texts:
i have cms custom header page i want to check

when  click on (custom header)
it will check customer logged in or not

i already try this

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$customerSession = $objectManager->get('Magento\Customer\Model\Session');
if($customerSession->isLoggedIn()) {
   // customer login action
}

  those  codes are showing in  headers

any one have idea???


texts:
My website is on Magento 2.1.11 version I uploaded all the products and setting up everything but after that, I noticed that my website images (Banner as well as products) not loading in the first time. if I want to load them I have to refresh the page each time. even the products are not loading in first time every time I have to refresh the page then it works fine.

I tried all the commands like resize image, Upgrade, clean cash, reindex. I don't know what I'm missing.

Website link- http://oyekitchen.com