texts: Magento 2. SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '100019997-1' for key 'SALES_ORDER_INCREMENT_ID_STORE_ID

texts:
After running the migration I find myself unable to place orders.

After some digging the error that is thrown is the one in the title:

SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '100019997-1' for key 'SALES_ORDER_INCREMENT_ID_STORE_ID

On sales_order there is increment_id value. My highest value is 100032938 but when the orderRepository saves the new order somehow 100019997 is generated. Now I have an order that already has that value and the increment_id column is an index which means unique values.

Deleting the existing order is not an option nor is truncating the sales_order table.

My question is how does Magento come up with this value 100019997.
I know that the first digit is he store id and I found information that the other number 199997 is taken from sequence_order_1 table and the zeros are added by some formula. In the sequence_order_1 I have  a value that is in the thirty thousands.

I've also tried. Cache cleaning and reindexing.

How can I make Magento or the DB (depending of who is responsible) to generate a valid increment_id when placing orders?

Any tips or pointers are appreciated. Thanks

PS: I've tried this with no success

Open MySQL database of your Magento 2 store with the help of phpMyAdmin.
Find the 'sequence_order_1' table . Note, that this table is located in the database itself, not in the 'information_schema'.
Hit the 'Operations' tab and edit the necessary 'increment_id' number under it.


texts:
i've developed a mobile application for my shopping store , but i want to create a api to retrieve all store data (category,product, payment method, cart, ...).

Any suggestions or tutorial to create my own api ?


texts: How can I edit Header tag in my Luma theme Magento 2?

texts:
In which file path  tag is available in Magento2? I need to customize the default header of the Magneto Luma theme.

Updated: I already checked header.phtml file but didn't find header tag.

Updated 1: I need to add below HTML inside the header.

i need to add inside the header tag..

                            <form>

                                    <input type="text" class="form-control" id="" placeholder="Search the store">

                            </form>

                                    Currency :
                                    <select class="select_currency">
                                        <option>INR</option>
                                    </select>

                                    <select class="select_currency">
                                        <option>Select Language</option>
                                    </select>

                                <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">

                                </button>


texts:
By Mistakes i have deleted my store view in magento version 1.9.3.6.

Can not able to see front end store view.

any help would be much appreciable.

Thanks


texts: can we send some data with other server url in controller magento 2 like below shown

texts:
Actually i am trying like this,Please check below code

  $this->_eventManager->dispatch('server url', ['FirstName' => $firstname,'LastName' => $lastname,'Postcode' => $Postcode,'EMailLogin' => $email]);


texts: How to see where the value is set from Catalog Product details

texts:
In Admin I can see the property prodfragrance dropdown set to few values.

I want to add more attribute to that?

How can i do that where to edit it ?

$product->getAttributeText('prodfragrance')

  I am brand new to Magento. Please share some lights to this,


texts:
In Magento 1 we are using zend_date in a following manner

new Zend_Date(date, 'MM-dd-Y');    or
new Zend_Date(date('M-01-Y', strtotime("+1 months", strtotime(date("Y-m-d")))));

But how can I use above method in Magento 2 ?

Thank you.


texts: How long does your setup:upgrade script take?

texts:
We're running a system with ~140,000 products on some good server hardware and wondered how long other sites take to do some basic tasks.

The magento setup:upgrade command takes almost 6 hours for us to complete.

I believe this is to do with it looking at just about every file within the main directory checking for file permissions etc.

We're using an NFS system to store static media on a shared location to allow our load balancers to send requests to two different application servers.

Is our hardware setup wrong? Or is this just how long it takes?

Your setup information and time to run this command would be appreciated.


texts: custom theme: add template file in default.xml

texts:
here my default.xml

 <body>
    <referenceContainer name="header-wrapper">
       <block class="Magento\Framework\View\Element\Template" name="customeline" template="Magento_Theme::customeline.phtml"/>
   </referenceContainer>
   <referenceBlock name="logo">
        <arguments>
            <argument name="logo_file" xsi:type="string">images/mytheme-logo-snake.png</argument>
            <argument name="logo_img_width" xsi:type="number">80</argument>
            <argument name="logo_img_height" xsi:type="number">80</argument>
        </arguments>
    </referenceBlock>
    <referenceBlock name="report.bugs" remove="true"/>
    <referenceBlock name="catalog.compare.sidebar" remove="true"/>
    <referenceBlock name="wishlist_sidebar" remove="true"/>
    <referenceBlock name="copyright" remove="true"/>
</body>

here my phtml file

<div class="block" style="float: left;">
<?php echo __('this is custom theme'); ?>
</div>

/frontend/Bigstore/Theme/Magento_Theme/layout/default.xml

/frontend/BIgstore/Theme/Magento_Theme/templates/customline.phtml

error:-

  exception #0 (Magento\Framework\Exception\ValidatorException): Invalid template file: 'Magento_Theme::customeline.phtml' in module: '' block's name: 'customline'


texts:
I have integrated WYSIWYG Editor using this tutorial. I can see it in my custom module, but when I try to insert variable it gives me following error in console

Error: ReferenceError: widgetTools is not defined
Source File: http://mywebsite.com/js/mage/adminhtml/wysiwyg/tiny_mce/plugins/magentowidget/editor_plugin.js
Line: 44

There is also another error when I try to insert widget,

Error: ReferenceError: widgetTools is not defined
Source File: http://mywebsite.com/js/mage/adminhtml/wysiwyg/tiny_mce/plugins/magentowidget/editor_plugin.js
Line: 44

Could anyone pls guide me on how to integrate WYSIWYG editor in backend custom module as well as frontend without having console errors.

Also how to add necessary WYSIWYG (TinyMCE) JS files to insert widgets, variables, images and other media types ?

Thanks.


texts: How to skip the Payment step in checkout and place the order. After place order i want to give option to payment for the order amount within a limited period of time to confirming order. I want to know how to achieve this in technical way in magento 2.


texts: Magento 1.9 How to add js to order review tab?

texts: I want to hide an the tax row, but I dont know when is generated so I can add some js to hide it.


texts:
This is my code from my function from controller:

public function step3Action(){
     $redirectUrl = Mage::getUrl('returns/rma_new/step2', array('m'=>'-1'));
     $this->_redirectUrl($redirectUrl);
     $redirectUrl2 = Mage::getUrl('returns/rma_new/step2', array('m'=>'-2'));
     $this->_redirectUrl($redirectUrl2);
     $redirectUrl3 = Mage::getUrl('returns/rma_new/step2', array('m'=>'-3'));
     $this->_redirectUrl($redirectUrl3);
}

Why am I redirect always to returns/rma_new/step2 with the -3 parameter  ?
instead of returns/rma_new/step2 with the -1 parameter
I am confused. thx


texts:
There was no 404 CMS page configured or found.

Backend settins are fixed properly but the issue is occur There was no 404 CMS page configured or found.

When I enable compilation process the 404 page not visible in magento

Without compilation 404 page working properly


texts: Apply category's display settings to all subcategories

texts:
I have about a dozen categories with hundreds of subcategories each, and I need to set the "Use Parent Category Settings" option under Custom Design to Yes on all the subcategories.

I tried what was explained here but it doesn't work with this particular setting as there is no database entry in the catalog_category_entity_int table for categories in which this setting hasn't been modified, in other words, only if I manually set the option to Yes, then an entry is created in the DB table above.

So, is there any other way to bulk edit this option for all subcategories?

Thanks!


texts: How can I remove not existing images in magento 1.9.2

texts:
How can I remove not existing images from magento. In the database  have images but file is not exist. I want deleted this images from database, because they show on product page with "NoImage" image. I wrote script which export entity_id and not existing path to file.

This script return following result:

entity_id   image_path
178559  /catalog/product/i/m/image_1.jpg
178559  /catalog/product/i/m/image_2.jpg
281136  /catalog/product/i/m/image_122.jpg
173563  /catalog/product/i/m/image_121.jpg
8163    /catalog/product/i/m/image_12.jpg

How can I do that programmatically.


texts: How to update Magento core column from type int to decimal using declarative schema?

texts:
I want to update the core table column from type int to decimal.
<column xsi:type="int" name="column_name" padding="10" unsigned="true" nullable="false" identity="false" default="0" comment="comment"/>
I have updated the column as
<column xsi:type="decimal" name="column_name" scale="2" precision="20" nullable="false" unsigned="true" default="0" comment="comment" />
in my custom modules declarative schema.
While upgrade I am facing this exception.
Element 'column', attribute 'padding': The attribute 'padding' is not allowed.
Element 'column', attribute 'identity': The attribute 'identity' is not allowed.


texts:
I did now know the xml and its layout rendering. I want to change the positions of the blocks in the wishlist xml.

Here is the file wishlist_index_index. And here is the  block

 <block class="Magento\Wishlist\Block\Customer\Wishlist\Item\Column\Info" name="customer.wishlist.item.name" template="item/column/name.phtml" cacheable="false"/>
 <block class="Magento\Wishlist\Block\Customer\Wishlist\Item\Column\Comment" name="customer.wishlist.item.comment" template="item/column/comment.phtml" cacheable="false">
 <arguments>
   <argument name="title" translate="true" xsi:type="string">Product Details and Comment</argument>
 </arguments>
 </block>

These are two different blocks now i want to wrap them inside a div ? when they appear in the html side. How can i achieve this?


texts:
I have created some form that opens in new popup window. And there i have some text, combo box and buttons and i would like to add to these buttons magento button style, but how can get this style?

My created form lays in there: app/design/adminhtml/default/default/template/mycompany/label.phtml

Select label size:

                    <form action="LebelController.php" method="POST">

                        <select name="SIZE">
                                 <option value="1x5">1x5</option>
                                  <option value="15x10">15x10</option>
                                  <option value="15x37">15x37</option>
                                  <option value="70x42">70x42</option>

                                </select>
                                <input type="hidden" value="<?php echo Mage::getSingleton('core/session')->getFormKey()?>" name="form_key">
                                <input type="submit" name="submit" value="Go" style="width: 100px; height:40px; font-size: 130%;">

                        </form>

And this is my app/design/adminhtml/default/default/layout/mymodule.xml file

<mymodule_label_setlabel translate=”label”>
        Label
        <reference name=”root”></reference>
        <reference name=”content”>
            <block type=”mymodule/block_labelblock” name=”mymodule.labelblock” template=”mymodule/label.phtml”/>
        </reference>
 </mymodule_label_setlabel>

and finally this is my controller that opens in new window and shows my form:
app/code/local/MyCompany/MyModule/controllers/Adminhtml/LabelController.php

class MyCompany_MyModule_Adminhtml_LabelController
extends Mage_Adminhtml_Controller_Action
{
    public function setlabelAction()
        {
$output = $this->getLayout()->createBlock('core/template')->setTemplate('mycomapny/label.phtml')->toHtml();
                $this->getResponse()->appendBody($output);
}

i am wondering how can i add magento style to this button, if i could add also combo box magento style that would be also great. So how can i get this magento style for buttons?
p.s. this all happens in backend


texts: DELETE `catalog_product_index_eav_temp` FROM `catalog_product_index_eav_temp` creating locks on tables for minutes at a time

texts:
DELETE `catalog_product_index_eav_temp`  FROM `catalog_product_index_eav_temp

This query as well as one to build it runs constantly but if you search all the source code of m2 that table isn't even brought up and it also doesn't exist in the database table list.  But it's definitely in show processlist and makes it impossible to edit or add items.  It'll go away for a while and come back.

I traced it back to this core file:
magento/module-catalog/Model/Indexer/Product/Eav/Action/Rows.php

It says it runs from mass product actions but we don't run those often?


texts: What do I have to do to make my Magento 1 and Magento 2 stores PSD2 Compliant?

texts:
I see inconsistent information regarding Magento and PSD2 Compliance and an implementation date of September 14, 2019. What steps, if any, can be taken to make my Magento 1 store compliant?

Is this a "real" issue for US-based merchants using US banks?

From what I understand, Magento 2 will provide compliance with updated payment gateways, etc. so there's not a lot of mystery there...if I'm understanding it correctly (Source: https://community.magento.com/t5/Magento-DevBlog/3D-Secure-2-0-changes/ba-p/136460)


texts: How to show pervious and future steps on Onepage Checkout?

texts:
In onepage.phtml the line hides the step options:

<div id="checkout-step-<?php echo $_stepId ?>" class="step a-item" style="display:none;">

And upon returning from the controller, it sets the completed step to display:none

I've dug in, and cannot find the code that sets this display to none. I would like to customize this, showing the user what they have entered and possibly animating the display instead of the bulky loading from step to step.

Any help on where to start looking where this code is?


texts:
I have added 'jquery-1.10.2.min.js' in app\code\Vendor\Module\view\frontend\web\js\default.xml file for showing a pop up on clicking Add to Wishlist button for product in home page. But on including custom js, the default 'Add to Cart' , 'Remove Item' is not working in My Wishlist section. Is it possible to include js file only for home page by removing the file default.xml

The following is my default.xml file.

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

    <script src="vendor_Module::js/jquery-1.10.2.min.js"/>

    <script src="vendor_Module::js/jquery.easing-1.3.pack.js"/>
    <script src="vendor_Module::js/jquery.mousewheel-3.0.4.pack.js"/>
    <script src="vendor_Module::js/jquery.fancybox-1.3.4.pack.js"/>

    </head>
</page>


texts: Magento 2.3.1 Multiple categories showing active, How to remove duplicate active class?

texts:
In my instance, I have updated Magento 2.3.1 from 2.3.0.

I have an issue that more than one categories are showing active on each page.

it shows randomly selected more than one categories.

How could I solve this?

If anyone has any idea about it please share.


texts: How to update product position (number) in specific category programmatically

texts:
I would like to set all position-numbers in one specific category to 100 instead of 0 (default). Id like to do this once - not for future products in that category.

Thx in forward!


texts:
I am trying to display attributes of simple products on a grouped product page. I have everything setup to pull the info. My issue is how to display it correctly.
I have two foreach loops that display the data but I get:

Manufacturer: UPC: Manufacturer Part Number: X-Stream0100055PLV-A-B

When I want it to be

Manufacturer: X-Stream
UPC: 0100055
Manufacturer Part Number: PLV-A-B

The code used is

<?php foreach($gridattributes as $attrib){
echo '<b>'.$this->htmlEscape($attrib[label]).': </b>';} ?>

<?php foreach($gridattributes as $attribname=>$attribval){
echo ''.$this->htmlEscape($_item->getData($attribname)).'';} ?>

How can I merge these to display as my second example?
Thank you for any help.


texts:
How do we change the Default Stock or Default Source for Magento 2 MSI?
There is no option to do so
And when importing stock or Backorder " out of stock threshold " then it activates Default Source for the product instead of our wanted stock (SOH in the picture)


texts: Telephone Number validation in billing and shipping on frontend?

texts: I want the users to fill the Telephone field in a formatted way, for example, the format in my country is 03XX1234567. How can I set the field to only accept a number in this format else give an error?


texts: Magento 2.2.6: Scheduled catalog_product_alert cron jobs failing with NotLoadInfoImageException: Can't get information about picture:

texts:
I'm currently experiencing an issue where my scheduled catalog_product_alert cron jobs in the cron_schedule table are all failing to send a back-in-stock product alert. Each time these are executed, the following exception is thrown and the product alert email is never sent out while also setting the alert as having been sent in the product_alert_stock table.

[2019-03-26 00:45:03] main.CRITICAL: Can't get information about the picture:  {"exception":"[object] (Magento\\Catalog\\Model\\Product\\Image\\NotLoadInfoImageException(code: 0): Can't get information about the picture:  at /home/xxx/public_html/yyy/vendor/magento/module-catalog/Model/Product/Image.php:834, TypeError(code: 0): Argument 1 passed to Magento\\Catalog\\Model\\Product\\Image::loadImageInfoFromCache() must be of the type string, null given, called in /home/xxx/public_html/yyy/vendor/magento/module-catalog/Model/Product/Image.php on line 880 at /home/xxx/public_html/yyy/vendor/magento/module-catalog/Model/Product/Image.php:913)"} []

Does anyone know any possible reasons that I might be running into this issue? All of the products that I have been testing the back-in-stock alert with have images (base, small, thumbnail) so I don't know what could possibly be causing this issue.

I am currently using Magento ver 2.2.6

Any and all help would be really appreciated!


texts: Staging: frontend works fine, backend shows login but after login 404

texts:
I've made a staging-area for my Magento shop (magentodir.nl URL is example and not real :) )
Structure:

Live-store: magentodir.nl
Staging-store: magentodir.nl/staging

Staging front-end (staging.magentodir.nl) works perfectly but the backend give me the headaches. staging.magentodir.nl/admin shows me the admin-login page. However when I login it shows me the 404 error - Whoops, our bad... and this in my store-design and colors


texts: Configurable variation is unidentifiable - Magento 2.3.1

texts:
I'm getting the Configurable variation is unidentifiable  error when trying to import the configurable items to Magento 2.3.1.

I think I have the correct format for the csv, using the defined format,

configurable_variations
sku=WAL-WM-03-BLA-UNI,color=Negro,size=UNI|sku=WAL-WM-03-GOL-UNI,color=Dorado,size=UNI|

configurable_variation_labels
color=Color,size=Size

Any ideas?


texts:
What happens in Magento 1.9 if the browser window is closed during import? Is the import process simply terminated or does it continue in the background? I'm using Magento 1.9's built in feature.

I ask because it's always going to happen on that odd brain-lapse occasion and it's not very clear in the documentation. I presume the only thing necessary would be to recheck no error data was imported to the wrong fields and restart the procedure with the corrected import file?


texts: Magento REST role and Users Roles: which are the difference and how they are related?

texts:
I understood the meaning of roles for the users and how to manage them, but I didn't understand well the meaning of the REST roles and if they interact/interfere each other.

I couldn't find any example on internet.


texts: Magento 2: Can't update product page layout in custom theme

texts:
(heavily modified the question for simplicity and clarity)

As a test case I created <custom-theme>/Magento_Theme/layout/default_head_blocks.xml. Creating and modifying this file, according to the docs, should effect every page.

In my extended default_head_blocks.xml I added a bogus JS, just to see what pages it will be added to.

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <head>
        <script src="js/test-file.js"/>
    </head>
</page>

I can see test-file.js on category and CMS pages, but not on a product page.

In fact, I can't get any layout updates to have an effect on the product page. The product page has the inherited theme Magento Blank, plus my site logo, located in <theme-dir>/web/imges/logo.svg.

Any guidance on this issue would be appreciated.


texts: Magento 2 - jsError - Cannot read property 'autocomplete' of undefined

texts:
In every pages of my custom template on the console log I find this

  Uncaught TypeError: Cannot read property 'autocomplete' of undefined

the error come's from:

  Magento_Customer/js/view/authentication-popup.js at line 25

I haven't modify this file and never used it, what's the problem?


texts: Magento2 installation wizard hanged on 90%

texts:
I was installing Magento2 and the installation reached 90% and it staid there not moving for more than 15 minutes with no errors in the log console.

I have read on the Internet that I have to increase the value of max_execution_time in php.ini file to 18000 instead of 30.

I did, and restarted apache, then tried to open 127.0.0.1 hoping it will get me to that setup page again, but unfortunately I got "Apache2 Ubuntu Default Page" page.

I've tried 127.0.0.1/setup, but I got

  "Welcome to Magento Admin, your online store headquarters. To use the
  Magento setup wizard sign into your Admin account and navigate to
  System => Tools => Web Setup Wizard"

So I tried 127.0.0.1/admin (I've changed the administrator page to admin in the setup wizard) but I got "Not Found" page.

What should I do now :(


texts: Catalog Price Rule not showing "Discount" value in cart totals

texts:
I have a site with a Catalog Price rule and a Shopping Cart Price Rule.

If you use a Shopping Cart Price Rule, there is a "Discount" row added to the basket totals summary showing the discount label and the value discounted.

If you use a Catalog Price rule, the unit price/total is discounted but you don't get a "Discount" row added to the basket totals summary. On the product pages I am seeing "Original Price/Special Price" but it's almost like once you click through to the cart Magento no longer recognises that the product is discounted and thinks the new price is the original price.

For example, a 50% off catalog price rule to a £10 product. On the product page this shows as "Original price: £10" and "Special Price: £5". This is fine. But on basket...

Expected results (same as Shopping Cart):

Unit Price: £10.00
Subtotal: £10.00
Discount: -£5.00
Grand Total: £5.00

Current results:

Unit Price: £5.00
Subtotal: £5.00
(No discount row)
Grand Total: £5.00

Is this expected behaviour or do I have a problem somewhere? Thanks very much.

I'm using Magento CE 1.7.0.2


texts:
How to change the style of the custom options in magento 1.9, like font-size, etc.

Can this be done from the admin panel?


texts: Product view and search result on the same

texts:
If I use the navigation menu to arrive at a product "detail" page then it all shows up nicely. But if I use the search to arrive at a product "detail" page then the picture and title show up but no pricing or description show up. This, I now know, has to do with the search view not providing a category ID.

Here it is when you use the search feature to arrive at the page.

Here it is when you use the regular navigation to arrive at the page.

Here is the error message that I get on that page when I turn on error reporting
Fatal error: Call to a member function getId() on a non-object in /../../public_html/store/app/design/frontend/rwd/default/template/catalog/product/view/type/availability/default.phtml on line 38

The code throwing the error is

$currentCategory = Mage::registry('current_category');

on line 38 but I don't understand how to fix it so the code responds on search and product pages.

<?php
    $manageStock = $_product->getStockItem()->getManageStock();

    $inventoryQuantity = (int)Mage::getModel('cataloginventory/stock_item')->loadByProduct($_product)->getQty();

    $currentCategory = Mage::registry('current_category');
    $curID = $currentCategory->getId();

    $one = 71;
    $two = 8;
    $three = 4;
    if ($manageStock == 1) // If 'Manage Stock' is set to YES
        {
        // If 'Qty' is less than or equal to zero
        /*if(($inventoryQuantity <= 0) && ($curID == $one || $curID == $two || $curID == $three)) { ?> */
        if(($inventoryQuantity <= 0) && (in_array($curID, array($one, $two, $three)))) { ?>

                <?php echo $this->__('Availability dependent on shipping method.'); ?>

        <?php }
        // If 'Qty' is less than or equal to zero
        if(($inventoryQuantity <= 0) && ($curID != $one && $curID != $two && $curID != $three)) { ?>

                    <?php echo $this->__('Out of Stock'); ?>
                    <?php echo $curID; ?>

        <?php }
        else if($inventoryQuantity > 0) { ?>

                    <?= (int) Mage::getModel('cataloginventory/stock_item')->loadByProduct($_product)->getQty()?><?php echo $this->__(' In Stock'); ?>

        <?php }
        }
    ?>

Any thoughts? It's been driving me crazy!

Thanks in advance!


texts: In Magento 2, how can I get all orders (particularly total amounts of orders) without using objectManager, by using REST methods

texts: I am a complete Magento 2 noob, I need to get all order amounts without going into objectManager, how can I do this using REST methods? So, I need to traverse ALL orders using REST service of Magento.


texts: Magento 2 in Backend Order Creation how to override shipping method section

texts:
I have created a custom module in magento 2 and override sales_order_create_index.xml layout file in custom module and set referenceBlock.
But issues that when first time page is loading from magento core module and again refresh page then my custom module file is call.
can any one suggest me how can i call my custom module file at the time of first loading ??
layout file sales_order_create_index.xml
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">

        <referenceBlock name="shipping_method">
            <block class="vender\module\Block\Adminhtml\Createorder" name="customblock"
                   template="vender_module::createorder.phtml" after="-"/>
        </referenceBlock>

</page>

Block file
Createorder.php
<?php
namespace Vender\Module\Block\Adminhtml;
use Magento\Backend\Block\Template;

class Createorder extends Template
{

}

template file createorder.phtml

<?php echo "hi";?>


texts:
I new on Magento and as you can guess I have a question.
I Have magento community 1.8, and I saw that my table
'newsletter_subscriber' field change_status_at is always null.

I don't know where to look to properly feed this field.
some help will be apreciate.

Thank you


texts:
I adding my product to bx slider...
i calling data from catalog model ....
how can i get price on slider...
my magento code is ..

    <?php
     $category = new Mage_Catalog_Model_Category();
    $category->load(6);
    $_products  = $category->getProductCollection();

    $_products->addAttributeToSelect('*');
    $_products->addAttributeToFilter('status', 1);
    $_products->addFieldToFilter(array(array('attribute'=>'visibility', 'neq'=>"1" )));

    $_products->getSelect()->limit(30);
      ?>

my slider html..
----------------

                <?php $i=0; foreach ($_products->getItems() as $_product): $i++; ?>
                    <div class="slide <?php if(($i == 4 && $_products->getSize() < 5) || ($i == $_products->getPageSize())) echo 'last'?>">
                        <?php echo $this->getReviewsSummaryHtml($_product, 'short') ?>
                        <a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->htmlEscape($_product->getName()) ?>" class="product-image"><img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(210) ?>" width="210" height="210" alt="<?php echo $this->htmlEscape($_product->getName()) ?>" />

<?php include('view/labels.phtml'); ?>

<a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->htmlEscape($_product->getName()) ?>"><?php echo Mage::helper('core/string')->truncate($this->htmlEscape($_product->getName()), $length = 30, $etc = '...', $remainder = '', $breakWords = true); ?>

                            <?php echo $this->getPriceHtml($_product, true) ?>

                <?php endforeach; ?>


texts: Product list slow (category and searchresult pages), what can i change/remove?

texts:
I'm fighting with the product list view, it is loading too slow.
When pages are cached, speed is OK (stupid to tell this, but maybe this info is needed ;-))

Mysql queries: +- 800 per category or new search request (I think this is that much because I have 190 000 products in my shop).
All settings are OK (what I can see with mysql tuner and other stuff like profiler).

I think the problem is somewhere in the attributes that needs to be loaded in the list.html. I have seen on other people posts there is a problem with $attrs  = $_product->getTypeInstance(true)->getConfigurableAttributesAsArray($_product); I cannot find where that code is located and if I need to change that file to get my custom attributes faster.

Is there a easy way to find the attribute or code that is slowing down list.phtml?

Maybe 1 file where I can remove stuff and recheck the load time after I removed stuff?

I have also tried to remove blocks in the local.xml but that was not fixing the load time.

I have changed the "new product" stamps, so it won't load "new" but my custom attribute (% a product is dropped, just a textfield no calculating with php just plain text).

I load that custom attribute and load different "buy now" buttons.

depending on a custom attribute,
if (attribute = "ID") {
 then load this button
}
if (attribute ID = 2) {
 load this button
}

So I just load 2 custom attributes, maybe attributes are not the problem. But it needs to be somewhere. The thing I know for sure is when I add more products the loading time will be longer.

Suggestions are welcome, thanks.


texts: Item URL in {{var items}} is going to url without ".html" extension so Error is showing No CMS Page Found

texts:
We have installed this extension and in email template Item URL in {{var items}} is not going to Correct Item URL

It is going to "www.mydomain.com/item-url", not "www.mydomain.com/item-url.html"

Due to this it is Showing Error There was no 404 CMS page configured or found.

How to Debug/Solve this?

This is our email template

Dear Customer,

                    We noticed you didn't complete the checkout process and your items were left in the cart.

                    If you are having trouble placing your order and need help, please reply to this email
                    and we will assist you as soon as possible or feel free to call us on 18000000.
                    You can check the items in your Cart by logging into your account.

                            Item
                            Sku
                            Qty
                            Subtotal

                        {{var items}}

Thank you, {{var store.getFrontendName()}}


texts:
I am trying to move my search bar bar into the white bar so that I can delete the tan bar:

But I don't know where to look to find the code for the search bar either in the admin panel or in code.


texts: Template Path Hints not showing on front-end in magento2

texts:
In my case, after enable the path Hints, from magento2 back-end section, its not showing. I enabled the settings in.

  Store > Configuration > Advanced > Debug > Enabled Template Path Hints for Storefront > Yes

Can anyone tell me how fix this ?


texts: Register a customer via ajax in magento 2.1

texts:
I need a code to register a customer via ajax in magento 2 , If any body have any samples please share

thanks


texts: Database Corruption? Double of every category filter attribute

texts:
I added a second category filter area to the category page by adding this to my local.xml:

<action method="append"><block>catalog.leftnav</block></action>

And output it by add this to my .phtml:

<?php echo $this->getChildHtml('catalog.leftnav') ?>

It worked, once. Then It threw a Magento exception page, which started:

  There has been an error processing your request

  You cannot define a correlation name 'sfoi' more than once

  Trace:

  0 C:\wamp\www\Project1\lib\Varien\Db\Select.php(281): Zend_Db_Select->_join('left join', 'am_sales_flat_o...', 'e.entity_id = s...', Array, NULL)

  1 C:\wamp\www\Project1\lib\Zend\Db\Select.php(357): Varien_Db_Select->_join('left join', 'am_sales_flat_o...', 'e.entity_id = s...', Array, NULL)

I then went back to the category page and found every custom attribute in the navigation filter box is doubled - two of each filter attribute.

I'm guessing it added a join somewhere. Any ideas on how to sort this? Thanks


texts: How can I change the little garbage icon in my shopping cart? It's the one that removes the items from shopping cart? Mine is too small and one can hardly see what it is. Thanks


texts: Cache Storage Management section is not displayed

texts:
I need to refresh my cache. But when i go to cache management page. It doesn't showing the cache storage management section. That section is blank

If someone faced these type of issue or anyone who know the reason for this , suggest me some idea


texts: Importing Product attribute values, an alternative method?

texts:
By default, when importing products into magento via csv file, and you want to provide values for attributes for those products, you have to enter the attribute codes in the first line of the csv file, eg:

sku,colour,brand,custom_attribute_one,custom_attribute_two, ..etc..

This is absoloutly fine if you are using only a small number of attributes in your store.

However, when you have thousands of attributes, this becomes a problem as you would need to generate x number of rows, depending on how many you are using. So, lets say 1000 attributes = at least 1001 columns in the csv.

To export data from a database to this kind of format would be a nightmare, when the data is already normalised in the database.

So, the question is whether there is a way to import a csv containing a limited number of columns as below:

sku,attribute_code,value

Baring in mind that both the products and attributes would already created in magento, and this step is just to populate the actual values of each attribute relating to each imported product.

So, an example csv might look something like:

sku,         attribute_code,            value
UE46F5500AK, i_944_display_diagonal,    46
UE46F5500AK, i_11424_hd_type,           Full HD
UE46F5500AK, i_1585_display_resolution, 1920 x 1080
UE46F5500AK, i_39_aspect_ratio,         16:9

Now, i assume this would have to be done via a custom, or adapted php or dataflow script, and creating an array and using each column eg:

array(
sku[0]
attribute_code[1]
value[2]
)

However, with very little php knowledge i wouldnt even know where to start. If anyone could point me in the right direction that would be fantastic, as i have no idea of any other way to import all the values

edit. I already use magmi for importing of products, however there doesn't seem to be the needed functionality for importing the above csv example, ie you still have to enter each attribute code at the first line, which with a huge number of attributes, is no feasible


texts: Magento2 Add review form to custom module

texts:
I need to add review list and form to my custom module ,what should I do ? plz give me some useful method.

https://www.questarter.com/q/magento-2-add-review-form-on-custom-page-10_152353.html

i had try it , but  it is not working.


texts: Catalog Price Rules - Apply Rule - Fatal Error Max Time

texts:
I hope everyone is well. I have a problem with my Magento e-commerce, and I am trying to explain this in the most technical way possible (even though I am not an expert). I looked at other messages on StackExchange, but could not find anything.

Every time I try to apply a new Catalog Price Rules, and I have already more than 4 rules set, then, I receive a

Fatal error: Maximum execution time of 30 seconds exceeded in /home/deltoro/public_html/lib/Zend/Db/Statement/Pdo.php on line 289

It labels my rule as 'Active' , but it's not.

If I turn it 'Inactive' and apply the rule, then it updates without a problem.


texts:
How to fetch the current product id and add in this function?

Vendor\CatalogImportExport\Model\Import\Product.php

class Product extends \Magento\ImportExport\Model\Import\Entity\AbstractEntity
{
   const PRODUCTID = 'product_id';
   const TABLE_Entity = 'temp_tgs';
   const COL_ENTITY_ID = 'entity_id';

   protected $validColumnNames = [
    self::SKU,
    self::NAME,
];

 protected $_permanentAttributes = [self::SKU];

public function getEntityTypeCode()
{
    return 'my_import';
}

protected function saveAndReplaceEntity()
{
    $behavior = $this->getBehavior();
    $listTitle = [];
    while ($bunch = $this->_dataSourceModel->getNextBunch()) {
        $entityList = [];
        foreach ($bunch as $rowNum => $rowData) {
            if (!$this->validateRow($rowData, $rowNum)) {
                $this->addRowError(ValidatorInterface::ERROR_PRODUCTID_IS_EMPTY, $rowNum);
                continue;
            }
            if ($this->getErrorAggregator()->hasToBeTerminated()) {
                $this->getErrorAggregator()->addRowToSkip($rowNum);
                continue;
            }

            $rowTtile= $rowData[self::PRODUCTID];
            $listTitle[] = $rowTtile;
            $entityList[$rowTtile][] = [
              self::PRODUCTID => $rowData[self::PRODUCTID],
              //self::SKU => $rowData[self::SKU],
            ];
        }
        if (\Magento\ImportExport\Model\Import::BEHAVIOR_REPLACE == $behavior) {
            if ($listTitle) {
                if ($this->deleteEntityFinish(array_unique(  $listTitle), self::TABLE_Entity)) {
                    $this->saveEntityFinish($entityList, self::TABLE_Entity);
                }
            }
        } elseif (\Magento\ImportExport\Model\Import::BEHAVIOR_APPEND == $behavior) {
            $this->saveEntityFinish($entityList, self::TABLE_Entity);
        }
    }
    return $this;
}

protected function saveEntityFinish(array $entityData, $table)
{
    if ($entityData) {
        $tableName = $this->_connection->getTableName($table);
        $entityIn = [];
        foreach ($entityData as $id => $entityRows) {
                foreach ($entityRows as $row) {
                    $entityIn[] = $row;
                }
        }
        if ($entityIn) {
            $this->_connection->insertOnDuplicate($tableName, $entityIn,[
            self::SKU,
            self::COL_ENTITY_ID,   //trying this, but not saving
            //$this->_connection->lastInsertId(),
            ]);
        }
    }
    return $this;

}


texts: Magento 2 how to create various shipping methods from REST API response?

texts:
I already know how to create a single shipping custom method, with files system.xml, config.xml and Carrier.php, however I'm working with a REST API of a Carrier provider, and when I get the response, I get like 6 different shipping methods, from different Couriers, for example: Fedex, UPS and more.

How can I show this quotes and Couriers in Checkout Shipping side? I was checking USPS module and it has this code under vendor/magento/module-usps/etc/config.xml :

<allowed_methods>0_FCLE,0_FCL,0_FCP,1,2,3,4,6,7,13,16,17,22,23,25,27,28,33,34,35,36,37,42,43,53,55,56,57,61,INT_1,INT_2,INT_4,INT_6,INT_7,INT_8,INT_9,INT_10,INT_11,INT_12,INT_13,INT_14,INT_15,INT_16,INT_20,INT_26</allowed_methods>

But what I don't get, is how USPS module creates different shipping methods, also I will need to have different Courier codes, in collectRates method, for example, the default shipping method has just one courier code:

/** @var \Magento\Shipping\Model\Rate\Result $result */
        $result = $this->rateResultFactory->create();

        /** @var \Magento\Quote\Model\Quote\Address\RateResult\Method $method */
        $method = $this->rateMethodFactory->create();

        $method->setCarrier($this->_code);
       // $method->setCarrierTitle($this->getConfigData('title'));
       $method->setCarrierTitle("Pakkkee");

        $method->setMethod($this->_code);
        $method->setMethodTitle($this->getConfigData('name'));

        $shippingCost = (float)$this->getConfigData('shipping_cost');

        $method->setPrice($shippingCost);
        $method->setCost($shippingCost);

        $result->append($method);

I will need something like this:

for($i = 0; $i < _code.length; i++){
    /** @var \Magento\Shipping\Model\Rate\Result $result */
            $result = $this->rateResultFactory->create();

        /** @var \Magento\Quote\Model\Quote\Address\RateResult\Method $method */
        $method = $this->rateMethodFactory->create();

        $method->setCarrier($this->_code[$i]);
        $method->setCarrierTitle($this->getConfigData('title'));

        $method->setMethod($this->_code[$i]);
        $method->setMethodTitle($this->getConfigData('name'));

        $shippingCost = (float)$this->getConfigData('shipping_cost');

        $method->setPrice($shippingCost);
        $method->setCost($shippingCost);

        $result->append($method);

}

Same for getAllowedMethods();

public function getAllowedMethods()
    {
       for($i = 0; $i < _code.length; i++){
        return [$this->_code[$i] => $this->getConfigData('name')];
       }
    }

The number of Couriers is dynamic, so creating many methods in config.xml will not be useful.

Greetings and thank you!


texts: Parse error: syntax error, unexpected '[' in /home/vvamic/public_html/www.shopperz.biz/app/autoload.php on line 40


texts: Magento2: Store Configuration Table with multiple fields

texts: How can I get in the Store -> Configuration a multi-field tables whose values are serialized?


texts: Magento 2 console script dealing with area code not set / area code already set error

texts:
I've written a console for invoicing frontend orders

https://github.com/DominicWatts/AutoInvoice/blob/master/Console/Command/Invoice.php

If I put Magento\Sales\Model\Service\InvoiceService in the constructor and run setup:di:compile magento console throws an 'Area Code Not Set' error.

You can't set area code as part of the constructor because when you run this and other console commands you see 'Area Code Already Set' error.

I understand state and why setting the 'area' is necessary.

My workaround is to do the following

use Magento\Sales\Model\Service\InvoiceService;

protected function execute(InputInterface $input, OutputInterface $output)
{
    $this->state->setAreaCode(\Magento\Framework\App\Area::AREA_GLOBAL);
    $this->method();
}
public function method()
{
    $this->_objectManager = \Magento\Framework\App\ObjectManager::getInstance();
    $this->invoiceService = $this->_objectManager->create(InvoiceService::class);
    // do stuff
}

So basically using object manager at runtime instead of injecting.  I'm constantly reading that using the object manager is bad.  Therefore I feel like I'm not understanding a key concept.

So my questions are this:

a)  Is this the right way to work around the issue?

b)  If it's not - what is the correct approach?

c)  Does using object manager add resource overhead?  Or is it more that it will be deprecated at some stage.


texts: How to set product urls to no-index no-follow?

texts: How we can set the list of products urls to **no-index no-follow** those products are canonical


texts: Source code and Firebug give different html for top links

texts:
I need to correct this as the path in html source code is incorrect - somehow these broken links are changed to correct ones in the browser and when I look at the top links in firebug, the paths are correct. Anyway, I suppose Google sees those as broken links. The codes look like this:

Firebug

Omat tiedot

Toivelista

Kirjaudu sisään

HTML Source code of the same position

My Account

My Wishlist

My Cart

Checkout

Log In

I got to say I'm desperate to fix this, I really hope someone can help me out!


texts: Magento1 admin order status update 404 error page

texts:
I have Magento1 website but when Admin panel Order Grid select any order  then submit that order status update click on submit button show second page 404 error come. So solution please this problem.

I have given screen short.

Second page link like.

Main website url /index.php/orderstatus/adminhtml_orderstatus/massOrderStatus/

Below error show.

Sorry, 404 Page not found.

It looks like you may have taken a wrong turn and gone off the trail.

Don't worry. It happens to the best of us.

Here is a little map that might help you get back on track.


texts:
Please help me to find where i can edit the totals from order email template. I attached an image with what i want exactly.

*the language from picture is romanian but you understand what i mean.

Thanks in advanced.


texts: Magento 2: After update to PHP 7 checkout.phtml not loaded / no success message

texts:
i upgraded from PHP 5.6.x to 7.0.4. The shop itself is working fine, but after the onepage checkout on the success page (where normally the file /vendor/magento/module-checkout/view/frontend/templates/success.phtml is loaded, this file seems not to be loaded.
There is no success message, just the message "click here to get an account" which normally appears after the success message.
I activated path hints, but there is no success.phtml loaded...
The confirmation email is sent and the order is in the system correctly...
Just the text / messages are missing.
I deleted all cache (by hand via ftp), also full page cache...

The template hints are showing the following files:

/vendor/magento/module-theme/view/frontend/templates/html/skiptarget.phtml
/vendor/magento/module-theme/view/frontend/templates/html/title.phtml
/vendor/magento/module-checkout/view/frontend/templates/button.phtml
/vendor/magento/module-theme/view/frontend/templates/html/messages.phtml
/vendor/magento/module-theme/view/frontend/templates/messages.phtml
/vendor/magento/module-customer/view/frontend/templates/account/authentication-popup.phtml
/vendor/magento/module-customer/view/frontend/templates/js/section-config.phtml
/vendor/magento/module-customer/view/frontend/templates/js/customer-data.phtml
/vendor/magento/module-page-cache/view/frontend/templates/javascript.phtml
/vendor/magento/module-msrp/view/frontend/templates/popup.phtml
/vendor/magento/module-checkout/view/frontend/templates/registration.phtml

Has anyone a hint or an idea?
(Running on nginx)
Thank you.


texts: How to change the frontend model for an customer attribute?

texts:
I have the following issue, I added a datetime attribute for the customer entity. In database I save the value in GMT, but on customer info tab I want the time to be converted to store time.

When I use the text frontend type The time is shown in GMT, I want to create a custom type that is converting the time to the store time before showing.


texts: I am working on custom API development where i want to create multipart form post method for image upload.


texts:
I'm using custom magento theme, and changed a few things on it. I also wrote this problem to where I bought it.

I've been researched everything about that but nothing helped me.

When I use custom template's /layout/checkout.xml file It’s not progress to “payment information” tab, and also right sidebar checkout progress not working

If I change checkout.xml file from base theme’s checkout.xml file payment information can work very well but checkout progress still not working.

I'm trying to fix checkout progress problem.

Do you know any solution, anynone has same problem or just me?


texts: Magento in maintenance mode after importing database from live to test

texts:
I created a dump of my live database and imported it into staging by using n98-magerun.

./n98-magerun.phar db:import live.sql

But now my website is in maintenance mode, even though there is no maintenance.flag file.

I also tried to deactivate maintenance mode by using n98-magerun:

n98-magerun sys:maintenance

Response: Maintenance mode off

But it still fails and the maintenance site shows.


texts: Exception Error when container having space in htmlId?

texts:
I encounter this error when override empty.xml Layout for custom theme

I got this error

  1 exception(s):
  Exception #0 (Magento\Framework\Config\Dom\ValidationException): Element 'container', attribute 'htmlId': [facet 'pattern'] The value 'page-content inset' is not accepted by the pattern '[a-zA-Z][a-zA-Z\d-_:]*'.
  Line: 21

  Element 'container', attribute htmlId: 'page-content inset' is not a valid value of the atomic type htmlIdentifierType.
  Line: 21

when I tried to set container with Id having space

I want to know how it's works.

  it's work fine when i change id from page-content inset to page-content-inset


texts: magento 2.1 why static content deploy after every setup:upgrade

texts:
I have installed Magento 2.1.0 successfully and also created many modules.

Suddenly after every php bin/magento setup:upgrade command , its not generating static contents.

The problem is after every setup:upgrade needs to have static content deploy command otherwise no CSS and JS works. If anyone can suggest me for a solution and the reason would be appreciable.

deploy mode is : developer


texts: Magento main menu change the navigation and the entire body

texts:
Anyone has an idea, how to create a menu above the navigation menu that when you pick any of it it will change the navigation and the body?
For example:
Main menu : Men
Navigation bar for “men”, clothing.. ect and each have submenu
The entire body customize for men clothings,
If i pick for the main menu “women”, everything should be change to women (navigation, submenu, body)
Appreciate your support


texts: Cookies not working on IE11 on windows 10

texts:
Im testing our site on BrowserStack and it works in all browsers but Internet Explorer 11 on Windows 10.

I can't add products to the cart and Magento is is saying I must enable cookies in the browser but I have!  Also cookies are working on other sites, for example the demo site we bought our theme for.

When I go to the site below it says cookies are enabled
https://www.whatismybrowser.com/are-cookies-enabled

Not sure what to do?  Could it have something to do with my server or magento configuration?

We have Magento 1.9.2 running on an NGINX / HHVM server on a AWS ec2 box with Ubuntu 14.04

Update

I noticed that if I change Use HTTP Only to NO in System > Configuration > General > Web I can now add things to the cart and cookies seem to be working but the browser is still redirected enable-cookies CMS-page if the click on enable cookies in the Cookie notice at the bottom of the page.


texts:
I have an error during the compilation due to a not completed developed module. As I'm still working on the module I would disable it and continue the compilation. I used to do that on magento1.

I tried:

disable it with magento module:disable
run magento setup:upgrade
run the compilation again
Check app/etc/config.php the module name is not included

but magento keeps reporting error.

Is the only way to get rid of the module folder?


texts: Magento 2: New Customers display issue in Admin Customer Grid

texts:
In Magento 2.1.8, Customer Grid is populating from table customer_grid_flat rather than customer_entity. This is for fastest retrieval of data. But the problem is customer_grid_flat never gets populate until I manually reindex the grid using SSH.

For a quick hack I have changed the code in blow file

Line 37: vendor/magento/module-customer/Model/ResourceModel/Grid

Old Code

$mainTable = 'customer_grid_flat',

New Code

$mainTable = 'customer_entity', //'customer_grid_flat',

Now some columns are not showing data like Name, Phone, Country etc. because of missing joins with relevant tables. Can anyone please suggest any better solution.


texts: 301 Redirect the Out of Stock Product Pages

texts:
Want to redirect for the products who are out of stock to custom url

Had tried below url but it did not helped
https://stackoverflow.com/questions/4824072/magento-out-of-stock-product-seo-problem


texts:
i saved data but i want save upload image. But i have error. I have file phtml

Image: <input name="profile_image" type="file">
<input type="submit" value="Send participant informations">

And i have file save.php

<?php

namespace Commercers\Course\Controller\Participant;

use Magento\Framework\Controller\ResultFactory;

class Save extends \Magento\Framework\App\Action\Action
{
protected $_participantFactory;

protected $_config;

protected $_uploaderFactory;

protected $_imageModel;

public function __construct(
    \Commercers\Course\Model\ParticipantFactory $participantFactory,
    \Magento\Framework\App\Action\Context $context,
    \Commercers\Course\Helper\Config $config,
    \Magento\MediaStorage\Model\File\UploaderFactory $uploaderFactory,
    \Commercers\Course\Model\Participant\Image $imageModel
) {
    $this->_participantFactory = $participantFactory;
    $this->_config = $config;
    $this->_uploaderFactory = $uploaderFactory;
    $this->_imageModel = $imageModel;
    return parent::__construct($context);
}

public function execute()
{
    $resultRedirect = $this->resultRedirectFactory->create();
    $data = (array) $this->getRequest()->getPost();
    $imageName = '';

    if (!empty($data)) {
        $participantFactory = $this->_participantFactory->create();

        $imageName = $this->uploadFileAndGetName('profile_image', $this->_imageModel->getBaseDir(), $data);
        $participantFactory->addData($data);
        $participantFactory->setStatus($this->_config::STATUS_DEFAULT_PARTICIPANT);

        $participantFactory->setProfileImage($imageName);

        $participantFactory->save();

        $this->messageManager->addSuccessMessage('Participant saved !');

        $resultRedirect->setUrl('/course/participant/create');

        return $resultRedirect;
    }

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

public function uploadFileAndGetName($input, $destinationFolder, $data)
{
        if (isset($data[$input]['delete'])) {
            return '';
        } else {
            $uploader = $this->_uploaderFactory->create(['fileId' => $input]);
            $result = $uploader->save($destinationFolder);
            return $result['file'];
        }
    return '';
    }

}

Please help me with upload image!


texts:
What platforms do Magento 2 developers use to code live? By this I mean, make a change and view it in browser as soon as I save my file. I was thinking that I could use Nano to create files and do everything from command line. For my own live site, development is very slow as I have to:

Download the file I wish to change from Filezilla
Make changes to the file
Re-upload the file to filezilla
Terminal commands to upgrade and clear caches

This cannot be the most efficient way to develop surely. What do the rest of you do in order to develop for a live dev website?


texts: Magento 2 how to override Magento\Directory\Block\Data using preferences?

texts:
This is my code but the block is not overrided

My di file :

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

My PHP file :

<?php

namespace Vendor\Module\Block\Rewrite\Directory;

class Data extends \Magento\Framework\View\Element\Template
{
    public function getCountryHtmlSelect($defValue = null, $name = 'country_id', $id = 'country', $title = 'Country')
    {
        echo "test"; exit;

    }
}


texts: How to add "Maximum Qty Allowed in Shopping Cart" via csv import

texts:
I want to set Maximum Qty Allowed in Shopping Cart to specific value depend on product. Is there any way to add via csv import? I try with max_sale_qty keyword. But it doesn't work.

Thanks for your time.


texts: Value is not save in backend in magento2

texts:
I am using Magento 2.1.0, and i created two customer attribute, it succefully created in backend, and i am that in database, customer grid and customer information page.

but when i enter any value in that, it is not save.

<?php

 namespace xxxxxx\CustomerAttr\Setup;

 use Magento\Eav\Setup\EavSetup;
  use Magento\Eav\Setup\EavSetupFactory;
use Magento\Framework\Setup\InstallDataInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\ModuleDataSetupInterface;
 use Magento\Eav\Model\Config;

 /**
     * @codeCoverageIgnore
     */
       class InstallData implements InstallDataInterface
         {
/**
 * Customer setup factory
 *
 * @var CustomerSetupFactory
 */
private $eavSetupFactory;

/**
 * Init
 *
 * @param CustomerSetupFactory $customerSetupFactory
 */
           public function __construct(EavSetupFactory $eavSetupFactory, Config $eavConfig)
{
    $this->eavSetupFactory = $eavSetupFactory;
    $this->eavConfig = $eavConfig;
}

public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
{
    $eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);
    $eavSetup->addAttribute(
        \Magento\Customer\Model\Customer::ENTITY,
        'city',
        [
            'type' => 'varchar',
            'label' => 'city',
            'input' => 'text',
            'required' => false,
            'sort_order' => 100,
            'system' => false,
            'position' => 100,
            'is_used_in_grid' => true,
            'is_visible_in_grid' => true,
            'is_filterable_in_grid' => true,
            'is_searchable_in_grid' => true,
        ]
    );
    $eavSetup->addAttribute(
        \Magento\Customer\Model\Customer::ENTITY,
        'area',
        [
            'type' => 'varchar',
            'label' => 'area',
            'input' => 'text',
            'required' => false,
            'sort_order' => 100,
            'system' => false,
            'position' => 100,
            'is_used_in_grid' => true,
            'is_visible_in_grid' => true,
            'is_filterable_in_grid' => true,
            'is_searchable_in_grid' => true,
        ]
    );
    $sampleAttribute = $this->eavConfig->getAttribute(\Magento\Customer\Model\Customer::ENTITY, 'city');
    $sampleAttribute->setData(
        'used_in_forms',
        ['adminhtml_customer_address', 'customer_address_edit', 'customer_register_address' ,'customer_account_create']
    );
    $sampleAttribute->save();
    $sampleAttribute = $this->eavConfig->getAttribute(\Magento\Customer\Model\Customer::ENTITY, 'area');
    $sampleAttribute->setData(
        'used_in_forms',
        ['adminhtml_customer_address', 'customer_address_edit', 'customer_register_address', 'customer_account_create']
    );
    $sampleAttribute->save();

}
}

even, i have two field on registration page, and i want this attribute take data from field, how to make relation between this???


texts: Magento 2 - How to get a list of newly created products on homepage

texts: how I can get a list of newly created products? I want to display in frontend the latest added products.


texts: How to remove Register link from the header and rename Log in Magento2.2.5?

texts:
I want to remove Register link from the header and rename Log in in Magento2.2.5?

Refer screenshot.

Any help would be appreciated.


texts: Magento 2 why CSS was blocked due to MIME type mismatch

texts:
I have just added custom CSS in the app/Vendor/theme/Magento_Catalog/web/css/custom.css

After that, I have run the CLI command php bin/magento setup:static-content:deploy and clear the cache.

When I refresh the page I have found the below issue:

  The resource from
  “http://localhost/mageento2/pub/static/version1488530702/frontend/Vendor/theme/en_US/Magento_Catalog/css/custom.css”
  was blocked due to MIME type mismatch (X-Content-Type-Options:
  nosniff).

After that I have researched this issue and found the answer in below link:

Magento2 CSS was blocked due to MIME type mismatch (X-Content-Type-Options: nosniff)

I have changed settings already app/etc/di.xml after install the magento. Also, Changed the settings in Configuration Stores => Configuration => Advanced => Developer => Template Settings and change Allow Symlinks => No.

Also, when I go to the app\pub\static\frontend\Vendor\deom\en_US\Magento_Catalog, I couldn't found my custom.css file.

I have included this CSS in the app\design\frontend\Vendor\theme\Magento_Catalog\layout\catalog_product_view.xml

Please see the below is code of .XML file:

<?xml version="1.0"?>
<!--
/**
 * Copyright © 2016 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <head>
    <css src="Magento_Catalog::css/magnific-popup.css" />
  </head>
    <body>
        <referenceContainer name="content">
        <block class="Magento\Framework\View\Element\Template"
               name="custom.js" as="custom.js" template="Magento_Catalog::product/js.phtml"/>
    </referenceContainer>
        <move element="page.main.title" destination="product.info.main" before="-"/>
        <move element="product.info.stock.sku" destination="product.info.price" after="product.price.final"/>
        <move element="product.info.review" destination="product.info.main" before="product.info.price"/>
    </body>
</page>

I have put the CSS file in this directory app\pub\static\frontend\Vendor\theme\en_US\Magento_Catalog\css\custom.css

Can anyone describe why this issue is occurring? So, we can aware of this issue in future.

I have installed Magento ver. 2.1.3. Please help..


texts: Where is getShippingRateGroups() defined?

texts:
We've got several extensions installed but with a recent update, we're getting an obscure error.  In certain cases, no shipping quotes are available for the customer.  We've narrowed it doen to this line:

    <?php if ($groups = $this->getShippingRateGroups()):?>

checking as false.  We look for that function to find its definition and only see calls to it in three (magento 1.6.2.0) or 5 (1.8.0.0 clean) different scripts, no where is a definition for this.

What am I missing here?


texts: How to auto invoice a single item of an order?

texts:
I am trying to invoice a single product of an order. I have found exactly the same question here. So i have written a observer of sales_order_save_commit_after event and then integrate that code into my observer. But it seems like it is not working for me. Because When i place an order, it stucks in a loop. Am i making a mistake?

class Emmagento_Autoinvoice_Model_Observer {

public $order;
public $incrementid;

function afterSalesOrderSaveCommitAfter(&$event) {

    return $this->__process($event);
}

protected function __process($event) {

    $this->order = $event->getEvent()->getOrder();
    $order = Mage::getModel('sales/order')->load($this->order->getId());
    $this->incrementid = $order->getIncrementId();
    if (!$this->order->getId()) {
        return $this;
    }
    else {

        $this->createInvoice();
    }
}

protected function createInvoice() {
 $orderState = $this->order->getState();
 $order = Mage::getModel('sales/order')->loadByIncrementId($this->incrementid);
 $items = $order->getAllItems();
 $qtys = array();
                foreach ($items as $item) {
                    $_sku = $item->getSku();
                    $_catalog = Mage::getModel('catalog/product');
                    $_productId = $_catalog->getIdBySku($_sku);
                    $_product = Mage::getModel('catalog/product')->load($_productId);
                    if ($_product->getAutoinvoice() == "1") {
                        $qty_to_invoice = $item->getQtyOrdered();
                    } else {
                        $qty_to_invoice = 0;
                    }
                    $qtys[$item->getId()] = $qty_to_invoice;
                }
 $invoice = Mage::getModel('sales/service_order', $order)->prepareInvoice($qtys);
 $amount = $invoice->getGrandTotal();
                    $invoice->register()->pay();
                    $invoice->getOrder()->setIsInProcess(true);

                    $history = $invoice->getOrder()->addStatusHistoryComment(
                        'Partial amount of $' . $amount . ' captured automatically.', false
                    );

                    $history->setIsCustomerNotified(true);

                    $order->save();

                    Mage::getModel('core/resource_transaction')
                        ->addObject($invoice)
                        ->addObject($invoice->getOrder())
                        ->save();
                    $invoice->save();
                    $invoice->sendEmail(true, ''); //set this to false to not send the invoice via email
}


texts: When i call $this->loadLayout(); ite return error on catalogsearch

texts:
SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL
 syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near
 'AS `query_id`, `s`.`product_id` FROM `catalogsearch_fulltext` AS `s`
 INNER JOIN' at line 1

i am use FME filtering. but its not work with catalogsearch. its return above error.


texts:
I am a newbie in Magento and I want to understand the Cron Jobs, please.

If I want to create new cron job inside default cron group, but I want to set different schedules time for it, is it possible or I have to create custom cron group.

What is the difference between crontab.xml file and cron_groups.xml file?

In crontab.xml file I see each cron job has its own schedules but in cron_groups.xml file it seems the schedules are general for all cron jobs in the group, which one to use?

crontab.xml file:

<config>
<group id="default">
    <job name="<job_1_name>" instance="<classpath>" method="<method_name>">
        <schedule>* * * * *</schedule>
    </job>
    <job name="<job_2_name>" instance="<classpath>" method="<method_name>">
        <schedule>* * * * *</schedule>
    </job>
</group>
<group id="index">
    <job name="<job_3_name>" instance="<classpath>" method="<method_name>">
        <schedule>* * * * *</schedule>
    </job>
    <job name="<job_4_name>" instance="<classpath>" method="<method_name>">
        <schedule>* * * * *</schedule>
    </job>
</group>

cron_groups.xml file:

<config>
<group id="<group_name>">
    <schedule_generate_every>1</schedule_generate_every>
    <schedule_ahead_for>4</schedule_ahead_for>
    <schedule_lifetime>2</schedule_lifetime>
    <history_cleanup_every>10</history_cleanup_every>
    <history_success_lifetime>60</history_success_lifetime>
    <history_failure_lifetime>600</history_failure_lifetime>
    <use_separate_process>1</use_separate_process>
</group>

I do not understand what is the meaning of sconnector and ddg_automation cron group


texts: Disable button for certain user groups/roles

texts:
How to disable certain buttons of the features to specific roles in the admin panel.
For eg If the role "tester" is given access to view feature in sales/customize-feature in the admin panel, he should not be able to view "Add New " Button.
It's customized feature and not present in ACl list

Tried Magento 2 : How to disable/enable payment method based on customer? but did not work out.

I want to hide "Save And Email to the customer" but I am unable to find it in ACL file. Even I select only "My Quote/Order" with rest checkbox uncheck all features work on the admin panel of the desired role where i have to hide it.

Tried to disable via ACL but it did not work out

 <?xml version="1.0" ?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd">
    <acl>
        <resources>
            <resource id="Magento_Backend::admin">
                <resource id="Magento_Sales::sales">

                <resource id="TREO_MyQuote::quoteTop" sortOrder="150" title="My Quote/Order">
                        <resource id="TREO_MyQuote::quote" sortOrder="90" title="My Quote/Order">
                            <resource id="TREO_MyQuote::quotecto" sortOrder="90" title="CTO"/>
                            <resource id="TREO_MyQuote::approve_action" sortOrder="90" title="My Quote/Order Approve"/>
                            <resource id="TREO_MyQuote::send_email_to_customer" sortOrder="90" title="Order Send email to customer"/>
                        </resource>
                    </resource>
                </resource>

            </resource>
        </resources>
    </acl>
</config>


texts:
I am working on magento migration using default magento migration tool.

Followed all the steps and migrated data successfully.

I followed the below procedure to migrate data:

Took the dump of M1 Production site database to local
Installed M2 new instance.

Configured source and destination in config.xml file of migration tool

Data migration happen successfully.

Now i need to migrate the changes, Did the following changes.

Took the dump of M1 Production database into local(After 1 week of data migration)

Configured source and destination in config.xml file of migration tool

Then run the below command to migrate the changes.

   php -d memory_limit=10G bin/magento migrate:delta --auto vendor/magento/data-migration-tool/etc/opensource-to-opensource/1.9.3.4/config.xml

I am facing below error,

  Delta Delivering Failed - Deltalog for customer_entity, is not installed in Magento 2

Which means Data Migration Tool creates triggers in the source database. they are used in delta migration. source ->Delta Delivering Failed - Deltalog for customer_entity, is not installed in Magento 2

But this time the database is different where i took the latest dump to local and trying delta migration, which is making problem for me.

How can i migrate changes once the data transfer is done successfully.

Can anyone help me on this please. Thanks


texts: how many custom attributes type in magento

texts:
$setup->addAttribute('catalog_category', 'image1', array(
'input'         => 'image',
'type'          => 'varchar',
'group' => 'Slider Image',
'label'         => 'Image 1',
'visible'       => 1,
'required'      => 0,
'user_defined' => 1,
'backend'  => 'catalog/category_attribute_backend_image',
'frontend_input' =>'',
'global'        => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
'visible_on_front'  => 1,
));

how many input type for custom attribute like text,textarea

'input' => 'text',

can we add button as custom attribute and set action on it


texts: how to add extra attribute properties like upload image for attribute in Magento 2

texts: I want a image uploader option in Attribute Properties in magneto2


texts: Are Symlinks on templates a security problem, and if yes, why?

texts:
Magento recommends to not use templates via symlinks:

Advanced > Developer > Template Settings > Allow Symlinks

  Warning! Enabling this feature is not recommended on production environments because it represents a potential security risk.

Until today I can't see any risks here.

What is the risk?


texts: All other links redirect except downloader

texts:
I have a private client testing server set up and for some reason all the links work except for magento connect. For example.

http://myserver.com/clientname/ (is the root for the Magento installation)

When I click on Magento Connect from the admin panel it redirects to this site
http://myserver.com/clientnamedownloader

Now every other module/page seems to work and nothing seems abnormal in my .htaccess file and the correct permissions are setup for the folders.


texts:
You can disable logging in the admin as well as in local.xml so writing to the DB is completely stopped. See this for more info: http://www.axertion.com/tutorials/2012/12/how-to-disable-magento-logging-to-the-database/ . I know some large-volume sites that have logging disabled completely.

Is there any reason, other than being the admin's reference, to keep any logging (log_* and/or report_* data) at all?


texts: Problem in processing with 3k+ configuration combinations

texts:
This line was slow https://github.com/magento/magento2/blob/2.1/lib/internal/Magento/Framework/Interception/Interceptor.php#L146 tentatively it takes about 15 seconds each time when I try to change the configurable options. If I use

print_r($result) it is keep on loading with download in progress with 2GB+, so I stopped it.. Any idea to resolve this?


texts: Could not filter product collection in Mage_Catalog_Block_Product_List by a custom attribute in magento 1.9

texts:
I have an issue similar to this question , and i checked the 'Already answered link' too. But my issue is bit different.

The error is similar in the above link but with my custom attribute :

  SQLSTATE[42S22]: Column not found: 1054 Unknown column
  'e.product_store' in 'where clause',.
      ....
      ..

Im trying to filter collection by two attributes as shown below :

Mage_Catalog_Block_Product_List

$this->_productCollection = $layer->getProductCollection()
                    ->addAttributeToFilter(array(array('attribute' => 'hidden_countries', 'nlike' => '%'.$current_country.'%')))
                    ->addAttributeToFilter(array(array('attribute' => 'product_store', 'in' => $optionToFilter)))
                    ->setPageSize($limit)
                    ->setCurPage($currPage);

The first filter for : hidden_countries is working fine, and i have the issue with the second attribute.

  The issue happens if i switch to flat product table. i checked the
  catalog_product_flat_x tables & i found the custom attribute ('product_store') and its values already there.

Did a complete re-index . But that doesn't solved the issue.

I can filter the product collection by getModel('catalog/product'):

$products = Mage::getModel('catalog/product')->getCollection()
            ->addAttributeToFilter(array(array('attribute' => 'hidden_countries', 'nlike' => '%'.$current_country.'%')))
            ->addFieldToFilter(array(array('attribute' => 'product_store', 'in' => $optionToFilter)))
            ->setCurPage($this->get_cur_page());

AS i can see the variable $layer is an instance of Mage_Catalog_Model_Layer and i can see that the getLayer returns Mage::getSingleton('catalog/layer').

Does any body knows why i can filter on
Mage::getModel('catalog/product') but not on Mage::getSingleton('catalog/layer') ?


texts: Magento how to forced change order status to processing after creating shipment?

texts:
How to forced change order status to processing after creating shipment ? On the magento default the order status always change to complete when shipment is created. Here is the step by step scenario:

1) When order is pending upon creating shipment the order status will change to processing.

2) When order is in processing upon creating shipment the order status will change to complete.

So what I want is when order is in processing upon creating shipment the order status will NOT change to complete and I want the order to be still in processing.

What would be the best solution for this? Is anyone know how to solve this ?

Thank you.


texts:
I'm new to magento. Is there any way I can get a customer to upload an image when he is selecting a configurable product.

I don't know how to go through this.


texts: Problem on saving attribute. "The value of Admin must be unique."

texts:
Currently, I'm migrating a website from Magento 1 to Magento 2.
I've used the data migration tool and moved my data to Magento 2.

When I try to update a custom attribute called 'color_sw_selection', an error occurs like this "The value of Admin must be unique."

Even if I select the "Unique Value" property as "No".

Any ideas?

Thanks!

I'm using Magento 2.3.2


texts:
For some stange reason, the related product collection is always empty for my products:

$products = $this->getData('related_products');

even if I have set some related products in magento.

Any ideas why is this happening?


texts: magento 2.3.0 Product With customizable options showing error The product's required option(s) weren't entered

texts:
On Magento 2.3.0 i created simple product
Then i added 1 customizable option with checkbox not required.
After saving product when i click on Add to cart button without selecting checkbox (Because it is not required field) it shows me this error

The product's required option(s) weren't entered. Make sure the options are entered and try again.

I searched for this error and i found that someone raised this issue before on github

https://github.com/magento/magento2/issues/19267

Definitely this is critical bug on magento 2.3.0 version and still not fixed by them.
We updated our store from 2.2 to 2.3 on dev server for testing.After facing this error it seems like its not good solution to update to magento 2.3 version.  Can anyone provide me quick fix of this error ?


texts: Get product prices with multiple websites

texts:
I have setup my Magento with 2 websites, with ID 1 and 4, and one store for each website.

My product has 3 prices: a Default price, and a price for each website.

How can I get these 3 prices programmatically?

See what I have tried so far:

$product = Mage::getModel('catalog/product')->loadByAttribute('sku', $sku);
echo $product->getPrice() . "
" ;      // prints price of default website != default price
echo $product->setWebsiteId(1).getPrice() . "
" ; // throws exception


texts: Magento2 : Admin module Image upload code to display form

texts:
I have magento2 admin custom module with image upload functionality. I want to upload image from admin. what code should apply for display image field in from, upload image, also image display in edit action.

Thanks

File Path : app\code\[Vendor]\[Module]\Block\Adminhtml\Emp\Edit\Tab\Main.php

    /**
     * Prepare form
     *
     * @return $this
     * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
    */
    protected function _prepareForm()
    {
        $model = $this->_coreRegistry->registry('emp_post');

        $isElementDisabled = false;

        /** @var \Magento\Framework\Data\Form $form */
        $form = $this->_formFactory->create();

        $form->setHtmlIdPrefix('page_');

        $fieldset = $form->addFieldset('base_fieldset', ['legend' => __('Employee Information')]);

        if ($model->getId()) {
            $fieldset->addField('customer_id', 'hidden', ['name' => 'customer_id']);
        }

        $fieldset->addField(
            'firstname',
            'text',
            [
                'name' => 'firstname',
                'label' => __('First Name'),
                'title' => __('First Name'),
                'required' => true,
                'disabled' => $isElementDisabled,
                'value' =>'abc'
            ]
        );

        $fieldset->addField(
            'lastname',
            'text',
            [
                'name' => 'lastname',
                'label' => __('Last Name'),
                'title' => __('Last Name'),
                'required' => true,
                'disabled' => $isElementDisabled,
                'value' =>'abc'
            ]
        );

        $fieldset->addField(
            'email',
            'text',
            [
                'name' => 'email',
                'label' => __('Email Address'),
                'title' => __('Email Address'),
                'required' => true,
                'disabled' => $isElementDisabled,
                'value' =>'abc'
            ]
        );

        $fieldset->addField(
            'image',
            'image',
            array(
                'name' => 'image',
                'label' => __('Image'),
                'title' => __('Image')
            )
        );

        $fieldset->addField(
            'telephone',
            'text',
            [
                'name' => 'telephone',
                'label' => __('Telephone'),
                'title' => __('Telephone'),
                'required' => true,
                'disabled' => $isElementDisabled,
                'value' =>'abc'
            ]
        );

        $dateFormat = $this->_localeDate->getDateFormat(
            \IntlDateFormatter::SHORT
        );

        $fieldset->addField(
            'dob',
            'date',
            [
                'name' => 'dob',
                'label' => __('Date of birth'),
                'date_format' => $dateFormat,
                'disabled' => $isElementDisabled,
                'class' => 'validate-date validate-date-range date-range-custom_theme-from'
            ]
        );

        $fieldset->addField(
            'is_active',
            'select',
            [
                'label' => __('Status'),
                'title' => __('Status'),
                'name' => 'is_active',
                'required' => true,
                'options' => $this->_status->getOptionArray(),
                'disabled' => $isElementDisabled
            ]
        );
        if (!$model->getId()) {
            $model->setData('is_active', $isElementDisabled ? '0' : '1');
        }

        if($model->getData('image')){
            $model->setData('image','learning/images'.$model->getData('image'));
        }

        $form->setValues($model->getData());
        $this->setForm($form);

        return parent::_prepareForm();
    }


texts: How to change base skin url based on browser nginx

texts:
I'm running an https magento site on a nginx server.  I'd like to serve my static content from a cdn (Amazon Cloudfront).

I can do this easily by changing the media/css/js urls from

www.mysite.com/xxx
to
cdn.mysite.com/xxx

however older browsers & operating systems (XP for example) don't support the SNI that makes this possible.

So, my question is:

How can I set my media/css/js base urls to be (www.mysite.com/xxx) when I detect that a user is running XP (for example), but leave them as cdn.mysite.com/xxx by default

I'd prefer not to have to set up multiple stores, just to be able to change these variables without the user knowing anything about it.


texts: Magento 2 : Which SQL query will be executed in attributes clean console command?

texts:
Does any one know which sql query will be executed while running below console command?

$ php bin/magento catalog:product:attributes:cleanup


texts: Magento 1.9.2.4 sending to multiple people

texts:
I have a customer i do marketing for and all of the sudden magento ver 1.9.2.4 started to send the first invoice to the customer and two other customers? These are different people each time. Have you come across this?

Thanks


texts: Where to find Footer links in Magento 2?

texts:
Just wanna ask where can I find this it. I thought it was a footer at first but was wrong!

I'm talking about the links in the white background!


texts: Magento 2 Layout update xml not working for categories

texts:
I try to use my customized .phtml file for a certain category.

I go in Admin->Catalog->Categories->Design->Layout update xml

I put the following code in the field layout update xml,

   <referenceContainer name="content">
        <referenceBlock name="product_list">
            <action method="setTemplate">
                <argument name="template" xsi:type="string">Magento_Catalog::product/subcategory.phtml</argument>
            </action>
        </referenceBlock>
   </referenceContainer>

and this is how my catalog_category_view.xml look like

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

This is how the Design tab look like

So I wanted is to use my customized template subcategory.phtml instead of list.phtml for a certain category.

But what I did has no effect on the site.
I have cleared the cache.


texts: Magento 2: How to setup Cron job correctly?

texts:
I have read all I could find about configuring the Magento 2 Cron jobs, and this is what I did:

crontab -u <myself> -e

And then added:

*/1 * * * * /opt/php/bin/php /web/bin/magento cron:run
*/1 * * * * /opt/php/bin/php /web/update/cron.php
*/1 * * * * /opt/php/bin/php /web/bin/magento setup:cron:run

But it doesn't seem to be working...

/opt/php/bin/php

is what I get when I run

which php

but when I run

whereis php

I get

/usr/share/man/man1/php.1

Which one should I use as the < path to php binary >?

Am I missing anything else?

Thanks!


texts:
I've exported trough Customer > Export [CSV] all my customers from the old 1.9.2.4 Magento installation and now i'm trying to import them into the freash installation, same version of Magento but when i try to import the csv i get this error:

Can not find required columns: email, _website

When i open the csv there is actually an Email column but not a _website column.

Is there something i can do? Thank you! :D


texts: Magento 2: Save all product data outside Magento with Images

texts:
I have below code with Image Upload which is working fine. But images are not stored in Database Table as mentioned in Order.

include('app/bootstrap.php');

use Magento\Framework\App\Bootstrap;

$bootstrap = Bootstrap::create(BP, $_SERVER);
$objectManager = $bootstrap->getObjectManager();

$state = $objectManager->get('Magento\Framework\App\State');
$state->setAreaCode('frontend');

try {
    $_product = $objectManager->create('Magento\Catalog\Model\Product');
    $_productImages = $objectManager->create('Magento\CatalogImportExport\Model\Import\Product');

    $importDir = __DIR__ . '/pub/media/import/';
    $image1Name = "1.jpg";
    $image2Name = "2.png";
    $image3Name = "3.png";
    $image1 = $importDir . $image1Name;
    $image2 = $importDir . $image2Name;
    $image3 = $importDir . $image3Name;

    //$_product->addData(array('custom_attribute' => 'foobar')); // To SET Attribute Value

    $_product->setName('Test Product')
            ->setDescription('Test Product')
            ->setShortDescription('Test Product')
            ->setUrlKey('test-product')
            ->setCategoryIds(array(38, 41))
            ->setTypeId('simple')
            ->setAttributeSetId(4)
            ->setSku('test-SKU')
            ->setWebsiteIds(array(1))
            ->setStoreId(1)
            ->setVisibility(4)
            ->setPrice(1.5)
            ->setStatus(1)
            ->setWeight(0.5);

    $_product->setStockData(array(
        'use_config_manage_stock' => 0, //'Use config settings' checkbox
        'manage_stock' => 1, //manage stock
        'min_sale_qty' => 1, //Minimum Qty Allowed in Shopping Cart
        'max_sale_qty' => 2, //Maximum Qty Allowed in Shopping Cart
        'is_in_stock' => 1, //Stock Availability
        'qty' => 100 //qty
            )
    );

    $_product->addImageToMediaGallery($image1, array('image', 'small_image', 'thumbnail'), false, false); // Add Image 1
    $_product->addImageToMediaGallery($image2, array('image', 'small_image', 'thumbnail'), false, false); // Add Image 2
    $_product->addImageToMediaGallery($image3, array('image', 'small_image', 'thumbnail'), false, false); // Add Image 3
    $_product->save();

    echo "<pre>";
    echo "Product Id: ".$_product->getId();
    echo "</pre>";
    exit;
} catch (Exception $e) {
    print_r($e->getMessage());
}

Images are not displaying in Order.

I have my Customer Attribute Set named "Furniture" with it's All Attributes. Example: Type, Color, Size

Attribute set i can set here mine using setAttributeSetId. How to set Particular Attribute Set's Attribute Value in Above Code.

In short i need to Set All Fields which You do from Magento Admin while Adding New Product.


texts: After applied SUPEE 8788 on CE 1.9.2.2, no catalog images in frontend

texts:
My issue seems kind of unique as I was unable to find any answers yet.

I have a Magento CE 1.9.2.2 running. After applying SUPEE 8788, initially image uploader did not work. Thanks to advice on here got upload running.

But if I use the patched image.php file in app/code/Mage/Catalog/Helper or in app/code/local/Mage/Catalog/Helper (if it's placed there), all frontend catalog images are not shown, no error message. And if I use the unpatched image.php file, uploader in backend does not work, but images show in frontend.

What I already did:
- Flushed all caches
- flushed browser cache
- re-indexed catalog
- flushed catalog images
- media folder writable
- allowed blocks are whitelisted in system > permissions > blocks

I am using Ultimo Theme version 1.14.0. Since images are shown with the 'old' image.php file I do not think it has something to do with Ultimo 1.14.0, although only version 1.15.4 is fully SUPEE 8788 compatible, i.e adding allowed blocks automatically.

Any hint is greatly appreciated.


texts: Magento 1.9.0.1 - Error after Installation

texts:
I installed Magento 1.9.0.1 and right after the Installation I've got the following error (it resultet in a 504 Gateway Timeout).

I've modified the index.php to get the real error, since no log has been written.

Error in file: "/kunden/123123123/webseiten/mage-test/app/code/core/Mage/Weee/sql/weee_setup/install-1.6.0.0.php" - SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'intern_weee_tax' already exists, query was: CREATE TABLE `intern_weee_tax` (
  `value_id` int NOT NULL auto_increment COMMENT 'Value Id' ,
  `website_id` smallint UNSIGNED NOT NULL default '0' COMMENT 'Website Id' ,
  `entity_id` int UNSIGNED NOT NULL default '0' COMMENT 'Entity Id' ,
  `country` varchar(2) NULL COMMENT 'Country' ,
  `value` decimal(12,4) NOT NULL default '0.0000' COMMENT 'Value' ,
  `state` varchar(255) NOT NULL default '*' COMMENT 'State' ,
  `attribute_id` smallint UNSIGNED NOT NULL COMMENT 'Attribute Id' ,
  `entity_type_id` smallint UNSIGNED NOT NULL COMMENT 'Entity Type Id' ,
  PRIMARY KEY (`value_id`),
  INDEX `IDX_INTERN_WEEE_TAX_WEBSITE_ID` (`website_id`),
  INDEX `IDX_INTERN_WEEE_TAX_ENTITY_ID` (`entity_id`),
  INDEX `IDX_INTERN_WEEE_TAX_COUNTRY` (`country`),
  INDEX `IDX_INTERN_WEEE_TAX_ATTRIBUTE_ID` (`attribute_id`),
  CONSTRAINT `FK_INTERN_WEEE_TAX_COUNTRY_INTERN_DIRECTORY_COUNTRY_COUNTRY_ID` FOREIGN KEY (`country`) REFERENCES `intern_directory_country` (`country_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `FK_INTERN_WEEE_TAX_ENTT_ID_INTERN_CAT_PRD_ENTT_ENTT_ID` FOREIGN KEY (`entity_id`) REFERENCES `intern_catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `FK_INTERN_WEEE_TAX_WEBSITE_ID_INTERN_CORE_WEBSITE_WEBSITE_ID` FOREIGN KEY (`website_id`) REFERENCES `intern_core_website` (`website_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `FK_INTERN_WEEE_TAX_ATTR_ID_INTERN_EAV_ATTR_ATTR_ID` FOREIGN KEY (`attribute_id`) REFERENCES `intern_eav_attribute` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE
) COMMENT='Weee Tax' ENGINE=INNODB charset=utf8 COLLATE=utf8_general_ci

#0 /kunden/123123123/webseiten/mage-test/app/code/core/Mage/Core/Model/Resource/Setup.php(644): Mage::exception('Mage_Core', 'Error in file: ...')
#1 /kunden/123123123/webseiten/mage-test/app/code/core/Mage/Core/Model/Resource/Setup.php(421): Mage_Core_Model_Resource_Setup->_modifyResourceDb('install', '', '1.6.0.0')
#2 /kunden/123123123/webseiten/mage-test/app/code/core/Mage/Core/Model/Resource/Setup.php(327): Mage_Core_Model_Resource_Setup->_installResourceDb('1.6.0.0')
#3 /kunden/123123123/webseiten/mage-test/app/code/core/Mage/Core/Model/Resource/Setup.php(235): Mage_Core_Model_Resource_Setup->applyUpdates()
#4 /kunden/123123123/webseiten/mage-test/app/code/core/Mage/Core/Model/App.php(428): Mage_Core_Model_Resource_Setup::applyAllUpdates()
#5 /kunden/123123123/webseiten/mage-test/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Model_App->_initModules()
#6 /kunden/123123123/webseiten/mage-test/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#7 /kunden/123123123/webseiten/mage-test/index.php(87): Mage::run('', 'store')
#8 {main}

How can I solve this problem?


texts: Magento 2 When Add Date-picker On Frontend Custom Form

texts:
When i try to add date-picker on custom frontend form then give some

  Uncaught TypeError: Cannot read property 'call' of undefined
      at HTMLInputElement.$.datepicker._showDatepicker (calendar.js:549)
      at HTMLInputElement.dispatch (jquery.js:5226)
      at HTMLInputElement.elemData.handle

I try following code

 <input type="text" name="datepicker" id="datepicker" value="" class="datepicker">
<script>
    require(["jquery", "mage/calendar"], function($){
        $("#datepicker").datepicker({
            showMonthAfterYear: false,
            dateFormat:'mm/dd/yy',
            changeMonth: true,
            changeYear: true,
            yearRange: '2000:2020',
        })
    });
</script>


texts: applied shopping cart rule information display in product view page

texts:
I created simple shopping cart rule(using Discount Qty Step (Buy X)) for all products.its working fine in shopping cart.For user awareness I have written following code.

I created one function in Mage_Salesrule_Model_Validator

public function petdreamsrule($rule, $address=null, $myitem)
    {
       //$val=Mage::getModel('salesrule/validator');
        if ($this->_canProcessRule($rule, $address) && $rule->getActions()->validate($myitem)) {
               // var_dump($rule);
               return $rule;
            }
    }

and I'm calling in deafult.phtml(design.checkout/cart/item/) like this

<?php
            $rules = Mage::getResourceModel('salesrule/rule_collection')->load();
            foreach ($rules as $rule) {
                if ($rule->getIsActive()) {
                    $rule = Mage::getModel('salesrule/rule')->load($rule->getId());
                    $val=Mage::getModel('salesrule/validator');
                    $ruleinfo= $val->petdreamsrule($rule, $address=null ,$_item);
                    if($ruleinfo){
                        $ourdiscount=$ruleinfo->getDiscountAmount();
                        $breakqty=$ruleinfo->getDiscountStep();
}}}

upto this point working fine.

But i need to call same function in product view page.I'm getting null for ruleinfo.anyone can guide how to do it?


texts:
I am trying to add a text field to the product view on the front end of the site.

I appreciate this can be done through custom options but that would involve creating the option for every product that needs the text box.

Instead, I am trying to just create a text field within the template programmatically. However, I am unsure at how best to do this so that it might add itself to the database.

Any help on how to achieve this would be much appreciated. Thank you.


texts: save product details in custom table & display below My account

texts:
Once Registered customers click on "Create Product" button present in product view page, we are creating new product in database. now we need to

1)Save those newly created product details in custom Table : my_designs

we are successfuly doing with help of this code :

$data = array('title'=>fav1_id,'product_id'=>$product->getId(),'customer_id'=>
 Mage::getSingleton('customer/session')->getId());
$model = Mage::getModel('example/mydesign')->setData($data);

2)display those products in My Designs section in Customer's My Account by fetching values from my_designs table.

I am using module & I am trying below code to display those products under My Designs section.

Issue : in customer 1's Dashboard only Products created by customer 1 should display, but now its displaying all customer's Products.

<?php $collections = $this->getCollection(); ?>
<?php foreach ($collections as $key => $product) {
    $_product = Mage::getModel('catalog/product')->load($product->getProductId());
    echo $product->getId().'
';
    echo $_product->getName().'
';

}
?>

full module : http://www.filedropper.com/amasty-module1


texts: Issue in URL not showing www with domain name

texts:
I have issue with URL wants to add "WWW." before domain name or sub domain name.

URL is now shows in browser like "http://example.com/"

it should be "http://www.example.com/"


texts: URL redirect shell script provided with Magento EE 1.13.1, what are they meant for?

texts:
Magento EE 1.13.1 is provided with a bunch of scripts that are meant to help in the migration from previous Url management to the new one (Url Rewrite -> Url Redirect).

We have 4 scripts in /shell/ :

url_migration_to_1_13.php (documented here)
url_migration_from_1_13_0_0_to_1_13_0_2.php (documented here)
umt113_conflict.php
umt113_redirect.php

I cannot find any info related to scripts 3 and 4 ... any idea ?

Thanks


texts:
I've tried with drag/drop, but it doesn't save. It should be ID - Thumbnail - SKU - Manufacturer - Type - Quantity - Color - Size - Price - Status.

How can I change the order? Is it in Grid.php or maybe product_listing.xml?

Thanks


texts: How to get selected data from product detail page in wishlist

texts: I want to show all selected data from simple products with custom options in wishlist (image.phtml). How to get selected data in wishlist?