texts: Why is the $this->getOrders method always returns a null object in this code Magento

texts:
I am new to magento.I am trying to create a view for the purchase history for users.Already there is a page to display this(As I am using a template).But as a experiment I tried to create a new page with the same content.As my first step. I created a new php block and then I copied same the content from the old purchase history file to the new one(Without any change).Then I called that block in a cms page.But when I called the url of the new page,It gives this error

  Fatal error: Call to a member function getSize() on null in
  /home/bvbellpm/public_html/newtrades/app/design/frontend/base/default/template/customer/form/purchasehistory.phtml
  on line

This is the code which I used to display the history

<?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
<?php $_orders = $this->getOrders(); ?>

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

<?php echo $this->getPagerHtml(); ?>
<?php if($_orders->getSize()>0): ?>

            <?php echo $this->__('Order #') ?>
            <?php echo $this->__('Date') ?>
            <?php echo $this->__('Ship To') ?>
            <?php echo $this->__('Order Total') ?>
            <?php echo $this->__('Order Status') ?>
            &nbsp;

        <?php $_odd = ''; ?>
        <?php foreach ($_orders as $_order): ?>

            <?php echo $_order->getRealOrderId() ?>
            <?php echo $this->formatDate($_order->getCreatedAtStoreDate()) ?>
            <?php echo $_order->getShippingAddress() ? $this->htmlEscape($_order->getShippingAddress()->getName()) : '&nbsp;' ?>
            <?php echo $_order->formatPrice($_order->getGrandTotal()) ?>
            <?php echo $_order->getStatusLabel() ?>

                <a href="<?php echo $this->getViewUrl($_order) ?>"><?php echo $this->__('View Order') ?>
                    <?php /*|<a href="<?php echo $this->getTrackUrl($_order) ?>"><?php echo $this->__('Track Order') ?>&nbsp;*/ ?>
                    <?php if ($this->helper('sales/reorder')->canReorder($_order)) : ?>
                    | <a href="<?php echo $this->getReorderUrl($_order) ?>" class="link-reorder"><?php echo $this->__('Reorder') ?>
                <?php endif ?>

        <?php endforeach; ?>

But this same code works fine in the  old purchase history file.Why is this not working in the new page? .I think $this->getOrders() is returning a null object.But it is working fine in the old page.As far as I know $this->getOrders() is a magic method in Magento.So I think it can be used any  where.Can someone explain me the reason for this odd behavior?


texts:
I need to make button near add to cart button without touching core template files. Kindly help me in this case?

I am developing a extension. When Install that extension, the button should be created. what should I do for that?

Problem in Detail

I am working on a shirt design plug in in which we can buy a shirt and we can design & buy that shirt too. I need to put a button for designing shirt. By clicking on it we can design shirt. I've done everything except adding button. If I add button by modifying core templates, I can not use plug in anywhere.

So only I am asking, Is there any way to add button in product without modifying core templates?


texts: Why is CSRF protection needed for add-to-cart?

texts:
Magento has since recent versions a form_key as part of the add to cart action, to protect against I think CSRF attacks.

So now I wonder, is it really needed for this place, and why or better said, against which specific scenarios should it protect.


texts:
Any idea?

Preconditions

Starting from Magento CE 2.2.5
Upgrade from 2.2.5 to 2.2.6

Steps to reproduce

Starting from Magento CE 2.2.5
Created a terms and conditions (Store-->Terms and conditions)
Upgrade from 2.2.5 to 2.2.6
The Terms and conditions created are not visible in admin (Store-->Terms and conditions)

Expected result

I can edit the old terms and conditions
I can insert a new terms and conditions

Actual result

Old terms and conditions are not visible
In production mode I can add a new terms and conditions but is not visible in admiview
In developer mode there is an exception:

  2 exception(s): Exception #0 (Zend_Db_Statement_Exception):
  SQLSTATE[42S02]: Base table or view not found: 1146 Table
  'XXXXXX.checkout_agreement_store' doesn't exist, query was: SELECT
  agreement_store.* FROM checkout_agreement_store AS agreement_store
  WHERE (agreement_store.agreement_id IN ('1')) Exception #1
  (PDOException): SQLSTATE[42S02]: Base table or view not found: 1146
  Table 'XXXXXX.checkout_agreement_store' doesn't exist

The table exists in DB; note that in sql there isn't the prefix to table.


texts:
I am new to Magento. I want to create a menu with different pages, but I don't have a navigation bar on top. How do I add a navigationbar?

This is my topmenu.phtml:

<?php $_menu = $this->getHtml('level-top') ?>
<?php if($_menu): ?>

            <?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('top-navbar-before')->toHtml() ?>
            <?php echo $_menu ?>
            <?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('top-navbar-after')->toHtml() ?>

<?php endif ?>

Here is the static block:

Still no navbar. The page.xml has these lines:

        <block type="core/text_list" name="top.menu" as="topMenu" translate="label">
            Navigation Bar
            <block type="page/html_topmenu" name="catalog.topnav" template="page/html/topmenu.phtml">
                <block type="page/html_topmenu_renderer" name="catalog.topnav.renderer" template="page/html/topmenu/renderer.phtml"/>
            </block>
        </block>

Any ideas?


texts: How to use cloudflare free SSL with Magento?

texts:
I use flexible SSL in cloudflare and go to https of my magento site. The site loads but the theme is not loaded. Checked the source code and realize the css and js was loaded in http instead of https. I found an article from cloudflare and realized it is due to connection from cloudflare to web server is in http thus css and js src is in http.

I try to set the Base Link URL, Base Skin URL, Base Media URL and Base JavaScript URL started with //domain.com so that it will load assetts in same protocol as the main page in magento admin but it does not allow me to save. So I edit the core_config_data table directly and set Base Link URL, Base Skin URL, Base Media URL and Base JavaScript URL to started with //domain.com. Clear the /var/cache and /var/session and the site loaded nicely.

However I'm not sure what I did is correct way to using cloudflare free ssl with Magento, and what will be the consequences of this way? Anyone with experience using cloudflare free ssl on magento?


texts: i'm having a problem importing additional_attributes for products. i have them formatted the way the export file looks, but when i import them, it shows import completed fine but does not update any of the custom attributes. are there any logs available for magento 2 imports? i checked out this article, Are there any csv import logs kept?, but it appears to be for magento 1.


texts: Can't get order with OrderRepositoryInterface

texts:
I have an order in sales_order with entity_id = 1 and increment_id = 000000001.
Both ways of trying to get this order fails with the same response.
$searchCriteria = $this->searchCriteriaBuilder
            ->addFilter('increment_id', '000000001')
            ->create();

$orderList = $this->_orderRepository->getList($searchCriteria);

and
$orderList = $this->_orderRepository->get($orderId);

Any idea why do these throw the following exception?
{
    "message": "No such entity with %fieldName = %fieldValue",
    "parameters": {
        "fieldName": "orderId",
        "fieldValue": "1"
    }
}


texts: OnePage Checkout - Hide Payment method depending on selected shipping method

texts:
I have a problem that is driving me nuts.
What I'm trying to accomplish is the following:

During checkout I want to have different payment methods available depending on which shipping method was chosen.

I know there was already the same question before, but the answerrsprovided there didn't do he job. I tell you why:
I have done exactly what is suggested in the answer of OnePage Checkout - Hide Payment method depending on Shipping Method

What I have done is to create an Observer on the payment_method_is_active event:

class MyNameSpace_PaymentMethodFilter_Model_Observer{

public function paymentMethodIsActive(Varien_Event_Observer $observer){
    $event = $observer->getEvent();
    $method = $event->getMethodInstance();

    $result = $event->getResult();
    $carriers = Mage::getSingleton('checkout/session')->getQuote()->getShippingAddress()->getShippingMethod();
    if($carriers == 'flatrate_flatrate' ){
                if($method->getCode() == 'checkmo'){
                    $result->isAvailable = true;
                }else{
                    $result->isAvailable = false;
                }
        }

}
}

The Problem with this observer is, that the payment_method_is_active event is only dispatched when the onepage is loaded the first time. This means, that after saving the shipping method, the observer doesn't receive any event and therefore can not apply the changes to the payment methods.

The availability of payment methods would rather need to be set when checkout_controller_onepage_save_shipping_method is fired. But if I write an Observer for this event I don't know how I can access the current payment method instances to modify availability accordingly.

Can anyone show me how to solve my problem?

Thanks a lot!


texts: How to install Magento 2 with empty database password

texts:
I'm trying to install Magento 2 on server which doesn't use database password. It's a kind of cloud hosting and I don't have ability to set password there.

Is there any way to install M2 using CLI with empty password?

I tried this installation command call:

cd bin/; /usr/bin/php ./magento setup:install \
        --currency=USD \
        --base-url=<URL> \
        --base-url-secure=<URL> \
        --language=en_US \
        --timezone=America/Los_Angeles \
        --db-host=<HOST> \
        --db-name=main \
        --db-user=user \
        --backend-frontname=admin \
        --admin-user=admin \
        --admin-firstname=John \
        --admin-lastname=Doe \
        --admin-email=john@example.com \
        --admin-password=admin12

And I got exception:

Configuration array must have a key for 'password' for login credentials

Then I tried to provide empty password:

cd bin/; /usr/bin/php ./magento setup:install \
        --currency=USD \
        --base-url=<URL> \
        --base-url-secure=<URL> \
        --language=en_US \
        --timezone=America/Los_Angeles \
        --db-host=<HOST> \
        --db-name=main \
        --db-user=user \
        --db-password='' \
        --backend-frontname=admin \
        --admin-user=admin \
        --admin-firstname=John \
        --admin-lastname=Doe \
        --admin-email=john@example.com \
        --admin-password=admin12

But got another exception:

The "--db-password" option requires a value.

Do you know if Magento 2 installation on database server which doesn't use password is supported?

It worked fine for me with Magento 1, I've just provided empty password there:

--db_pass '' \


texts:
I have extended the Magento v2 API and want to return some translated strings. The only thing that is returned, are the original strings.

To test the translation, I also added the strings to the frontend, it worked.

    foreach (Mage::helper('mb-rentalapp')->getInterfaceStrings() as $interface_string)
    {
      echo $interface_string . '::' . Mage::helper('mb-rentalapp')->__($interface_string) . '</br>' ;
    }

In the API, I added the following to the response.

Mage::helper('mb-rentalapp')->__($interface_string)

After some debugging, I noticed that the Mage_Core_Model_Config_Element returned

Mage_Core_Model_Translate->getModulesConfig()

is populated in frontend, but completely empy in the API v2.

Before adding the translation in the response, I also ran:

Mage::app()->setCurrentStore($storeView->getId());
Mage::app()->getTranslator()->init()->setLocale($storeView->getConfig('general/locale/code'));

Is it even possible to translate in the Magento v2 API?


texts: image not display after upload with new category image upload attribute in magento 2

texts:
I have created new custom image uplaoder attribute for category. It's working good. I can upload image in category but when I go to category page, custom image uplaod attribute does not display image.

I follow this link to create custom image upload attribute

  https://belvg.com/blog/how-to-add-image-attribute-to-a-category-in-magento-2.html


texts: Need to translate the attribute set name

texts: We have different seller panel.And they only understand arabic language..So once they ad product they need to select the attribute set but They wants them in arabic is there way to translate it ?


texts: Magento 2.2.4 Cannot create configurable product - Infinite loading in Step 2 :Attribute Values , error in console

texts:
I cant create a configurable product in Magento 2.2.4 the configurable product setup wizard gets stuck in step two where it asks to add attribute values.

I have tried creating static-content:deploy for both frontend and backend.
Also cleared cache, ran reindexer, disabled varnish cache.
Still issue persists

Here is what I get in the console:

JQMIGRATE: Logging is active
loader_old.min.js:5 Expected to start loader but did not find one in
the dom_onAjaxSend @ loader_old.min.js:5
knockout.min.js:302
Uncaught ReferenceError: Unable to process binding "visible:
function(){return canCreateOption }"
Message: canCreateOption is not defined
at visible (eval at createBindingsStringEvaluator (knockout.min.js:268), <anonymous>:3:109)
at update (knockout.min.js:407)
at ko.dependentObservable.disposeWhenNodeIsRemoved (knockout.min.js:302)
at evaluateImmediate (knockout.min.js:183)
at Object.ko.computed.ko.dependentObservable (knockout.min.js:204)
at knockout.min.js:302
at Object.arrayForEach (knockout.min.js:17)
at applyBindingsToNodeInternal (knockout.min.js:299)
at applyBindingsToNodeAndDescendantsInternal (knockout.min.js:288)
at applyBindingsToDescendantsInternal (knockout.min.js:285)


texts: Moved Module from localhost to server, block type invalid

texts:
I know that a lot of similiar questions has already been asked, but none of provided solutions worked for me, so i decided to add this question.

I have created new block for getting products by id's, and send them via ajax. As i developed it on my local machine, everything was perfect. Then, i decided to migrate changes to staging server. Normally, when i go to http://localhost/example/pl/ajaxloader i get JSON with product's html.
Now, after migrating, when i go to
https://example.com/pl/ajaxloader i get this error:

  Fatal error: Call to a member function setData() on boolean in /home/klient.dhosting.pl/example.com/public_html/app/code/local/Projects/Ajaxloader/controllers/IndexController.php on line 39

I found our that my exception.log gives something like this:

  exception 'Mage_Core_Exception' with message 'Invalid block type: Mage_Projects_Ajaxloader_Block_Ajaxloader' in /home/klient.dhosting.pl/jett/example.com/public_html/app/Mage.php:595

Yet still i don't know how to make it work.

Here's my /app/etc/modules/projects_Ajaxloader.xml

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

And My /app/code/local/Projects/Ajaxloader/etc/config.xml

<config>
 <modules>
     <Projects_AjaxLoader>
         <version>0.1.0</version>
     </Projects_AjaxLoader>
 </modules>
 <frontend>
     <routers>
         <ajaxloader>
             <use>standard</use>
             <args>
                 <module>Projects_Ajaxloader</module>
                 <frontName>ajaxloader</frontName>
             </args>
         </ajaxloader>
     </routers>
     <layout>
         <updates>
             <ajaxloader module="Projects_Ajaxloader">
                 <file>Projects_Ajaxloader.xml</file>
             </ajaxloader>
         </updates>
     </layout>
 </frontend>
 <global>
     <blocks>
         <ajaxloader>
             <class>Projects_Ajaxloader_Block</class>
         </ajaxloader>
     </blocks>
 </global>
</config>

My /app/code/local/Projects/Ajaxloader/block/Ajaxloader.php

   <?php
      class Projects_AjaxLoader_Block_AjaxLoader extends Mage_Core_Block_Template {
      }

My /app/code/local/Projects/Ajaxloader/controllers/indexController.php

    class Projects_Ajaxloader_IndexController extends Mage_Core_Controller_Front_Action
       {

    public function indexAction()
    {

        // $url = $this->getRequest()->getPost('url');
        $product_ids = json_decode(file_get_contents($url));
        $_productCollection = array();

        $itemsStart = $this->getRequest()->getPost('itemsCount');
        $itemsEnd = $itemsStart + 12;
        $showLoader = false;
        $this->loadLayout();
        $layout = $this->getLayout();

        // build an array for conversion
        $json_products = array();
        $i = 0;

        $block = $layout->getBlock("hello")->setData('product', $_product);
          //and other logic , but here's where the error happens

    }

}

and my /app/design/frontend/rwd/example/layout/Projects_Ajaxloader.xml

    <?xml version="1.0" encoding="UTF-8"?>
   <layout version="0.1.0">
      <ajaxloader_index_index>
          <reference name="root">
            <action method="setTemplate">
                <template>page/1column.phtml</template>
           </action>
        </reference>
         <reference name="content">
            <block type="ajaxloader/ajaxloader" name="hello" template="ajaxloader/ajaxloader.phtml"/>
          </reference>
    </ajaxloader_index_index>
  </layout>


texts:
Parse error: syntax error, unexpected T_FUNCTION in /homepages/34/d512863470/htdocs/thriftyhorse/app/code/core/Mage/Core/Helper/Abstract.php on line 240

I updated some components of Magento since I was having trouble integrating USPS and thought that would help. Then I got the following issue. I saw this answer
Cron error on line 240 from Mage/Core/Helper/Abstract.php

It seems like the same problem, but I don't know how change the cron command. With my hosting, I cannot do it through the CPANEL as I've seen in other answers, only through PuTTy.


texts:
I am learning the Magento 2 proxy concept so that I followed the https://webkul.com/blog/magento2-proxy-design-pattern-code-generation/ blog and discovered the proxy concept.

I am a bit clear about the proxy theory, But I want to implement in real-time so that I followed the below procedure to learn the practical.

Model:

namespace Learn\Pricechange\Model;
class BulkService {

    public function __construct() {
        echo 'i am in bulk service instantiated'."<br/>";
    }
}

I am going to use this as a proxy in my controller.

Controller:

namespace Learn\Pricechange\Controller\Index;
use Learn\Pricechange\Model\BulkService;
class Change extends \Magento\Framework\App\Action\Action
{

    protected $_bulkService;
    public function __construct(
        \Magento\Framework\App\Action\Context $context,
        BulkService $bulkService,
        array $data = []
     ) {
        $this->_bulkService = $bulkService;
        parent::__construct($context);
     }

    public function execute(){
            echo 'bulkservice class is not instantiated';
    }
}

Then as per the proxy concept, I included the required code in frontend/di.xml

di.xml

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <type name="Learn\Pricechange\Controller\Index\Change">
        <arguments>
            <argument name="cart" xsi:type="object">Magento\Checkout\Model\Cart\Proxy</argument>
            <argument name="bulkservice" xsi:type="object">Learn\Pricechange\Model\BulkService\Proxy</argument>
        </arguments>
    </type>
</config>

so as per the above code when you hit the frontend, it should not instantiate the BulkService and do not print the constructor function value(i am in bulk service instantiated).

But in my case it's getting instantiated first and print the constructor function values(i am in bulk service instantiated) after that it's print the execute function value.

So i am bit confused this logic, I am looking forward the better support.


texts: Magento sales_order_grid + join concatenated results from other query

texts:
We have some queries / extensions adding columns to the sales_order_grid as a 1:N relation. Normally 1:1 relations work fine. 1:N relation need a group by statement on increment_id and use group_concat or SUM or some other group statement to 'merge' the 1:N results.

Our problem occurs when more than 1 extension/query uses the group concat. Then we are beginning to see duplicate results in some columns. Seaming using group_concat can best be used only once.

My question is: How can you best join a 1:N relation in a concatenated form to the original sales_order_grid without using group_concat.

I can think of nesting the concat subquery in the select statement. Or creating a view where the query results are stored and hence can be joined 1:1 instead of 1:N. Or the data can be stored in it's own method and joined like that - only often there is no 1 other table but the join is based om another query all together involving multiple tables.

Main table                 Query
sales_order_grid incr_id   select incr_id, group_concat(new_column) from T1 and T2, group by incr_id

As is the Query above is incorporated in the Magento select statement making it too complex. But how can we only add the 'result' of this subquery - so in essence the concat has already occured before adding it to the sales_order_grid select statement.

(I hope this is clear)

How can one remove the group_concat and group by in this query. And add it as a subquery in the SELECT using Magento and SQL methods/collections: how do we do the below "Magento style"

ORIGINAL

SELECT `main_table`.*, GROUP_CONCAT(warehouse_tbl.`warehouse_id` SEPARATOR '\n') AS `warehouse_ids`, GROUP_CONCAT(warehouse_tbl.`qty` SEPARATOR '\n') AS `warehouse_qtys` FROM `sales_flat_order_grid` AS `main_table` LEFT JOIN `safemage_multiinventory_warehouse_order_item` AS `warehouse_tbl` ON warehouse_tbl.order_id = main_table.entity_id AND warehouse_tbl.qty <> 0 GROUP BY `main_table`.`entity_id`

POSSIBLE SOLUTION

select *
FROM `sales_flat_order_grid` AS `main_table`
left join
(select warehouse_tbl.order_id as unique_id,
GROUP_CONCAT(warehouse_tbl.`qty` SEPARATOR '\n') AS `warehouse_qtys`,
GROUP_CONCAT(warehouse_tbl.`warehouse_id` SEPARATOR '\n') AS `warehouse_ids`
from `safemage_multiinventory_warehouse_order_item` AS `warehouse_tbl`
where warehouse_tbl.qty <> 0 GROUP BY warehouse_tbl.order_id) as wh
on wh.unique_id = main_table.entity_id


texts: How to have the changes made in .less file be reflected on the website?

texts:
I'm trying to make some style changes to a .less file in a custom module. But even after making and saving the changes to the .less file, those changes are not being reflected on the website. I'm using Magento in developer mode.
Is there a way around this(by using cli) which does not involve deleting pub or generated folders?


texts: Enable drop down attribute option in product page Magento 2

texts: I created attribute size in backend .I want to give the option to customer choose options from attribute value from product page .can any one tell how I call mydrop down attribute in product page.


texts: Products Category Tree - Product Quantity Inconsistencies

texts:
I've faced a strange situation in magento admin and haven't managed to find a proper answer for the issue.

Here it is:

As you can see for some reason numbers in brackets have completely no sense. One of them is not equal to the quantity in table (it is circled out). And it is completely unclear how the quantity for parent category is computed, cause at least it does not equal to the sum of its children's quantitties.

And so my question is: should I go deeper and try to find the reason for all of this or is it just strange, inexplicable but still normal behavior?


texts:
I want to show 4 products in one row on my Magento site.
I tried some tricks but it doesn’t work..

I set this in list.phtml

<?php $_columnCount = 4; ?>

but nothing..

I also put this in catalog.xml

<action method="setColumnCount"><count>4</count></action>

Here is my list.phtml and my catalog.xml

This is my screenshot:


texts:
I 'm able to get gmtDate.But,I can't not save that in db.How to save gmt time in database?

use Magento\Framework\Model\ResourceModel\Db\AbstractDb;
use Magento\Framework\Stdlib\DateTime\DateTime;
use Magento\Framework\Model\ResourceModel\Db\Context;

class Faq extends AbstractDb
{

    /**
     * Date model
     *
     * @var \Magento\Framework\Stdlib\DateTime\DateTime
     */
    protected $_date;

    /**
     * constructor
     *
     * @param \Magento\Framework\Stdlib\DateTime\DateTime $date
     * @param \Magento\Framework\Model\ResourceModel\Db\Context $context
     */
    public function __construct(DateTime $date, Context $context)
    {
        $this->_date = $date;
        parent::__construct($context);
    }

    /**
     * Define main table
     */
    protected function _construct()
    {
        $this->_init('faqs', 'id');
    }

    protected function _beforeSave(\Magento\Framework\Model\AbstractModel $object)
    {
        $object->setUpdatedAt($this->_date->gmtDate());
        if ($object->isObjectNew()) {
            $object->setCreatedAt($this->_date->gmtDate());
        }
        return parent::_beforeSave($object);
    }

If anyone knows please explain me?


texts: How to add custom validation for admin form in Magento 2?

texts:
I want to add custom validation in the text box in Magento 2.
How I can do it?


texts: Magento 2 : Add Custom Fee Based On Shipping and Billing Address

texts:
I already refer this :
how to add fee to order totals in magento2

But my requirement is diffrent.

I need to add custom fee in order total based on Shipping or Billing address selected by customer during checkout.

I need to add fee based on selected country.
See screen-sort.


texts: How to make a product shipable only to specific cities

texts:
How to make a product available only in specific cities. Example organic products will be available only in certain cities, so during checkout if the user selects city other than specified then the checkout process should give error stating "Products available only in so and so city.". Checkout process should not be completed unless a proper city is selected. I have tried with Shopping cart price rules but no luck. Any ideas or suggestions please?

Thanks,


texts:
When I run a patch it fails on one of the files. I would like to remove the respective line from the patch.x.x.x.sh so everything else is being patched except this file.

Hope someone can explain the procedure.

For example, I am trying to apply Patch SUPEE-10336 and get error:

[http]$ bash PATCH_SUPEE-10336_CE_1.9.2.4_v1.sh
Checking if patch can be applied/reverted successfully...
ERROR: Patch can't be applied/reverted successfully.

patching file app/code/core/Mage/Usa/Model/Shipping/Carrier/Usps.php
patching file app/locale/en_US/Mage_Usa.csv
Hunk #1 FAILED at 99.
1 out of 1 hunk FAILED -- saving rejects to file app/locale/en_US/Mage_Usa.csv.rej

I would like to edit the PATCH_SUPEE-10336_CE_1.9.2.4_v1.sh so I remove the line from the patch that's responsible for this file.


texts:
I am actually moving a custom dataflow extension from Magento 1 to Magento 2.

In M1 we can add custom configuration / mapping for each flow using XML. The XML structure is free and thought by the developer that he use with getNode() function in his code.

In M2 I would like to do the same thing. Have a file flow.xml where the developer put his flow mapping and configuration.
I create the correct Reader from this post https://magento.stackexchange.com/a/82049/33619 which is working fine.

Now my issue is with XSD for my flow.xml file to tell that node <mapping></mapping and <options></options> can contain whatever developer wants.
Here are my actual files :

# File flow.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Dnd_Flow:etc/flow.xsd">
    <mapping>
        // Here can be string or other nodes on X levels
    </mapping>
    <options>
        // Here can be string or other nodes on X levels
    </options>
</config>

My XSD file looks like this :

# File flow.xsd

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:element name="config" type="configType" />

    <xs:complexType name="configType">
        <xs:sequence>
            <xs:element type="xs:????" name="mapping" minOccurs="0" />
            <xs:element type="xs:????" name="options" minOccurs="0" />
        </xs:sequence>
    </xs:complexType>
</xs:schema>

I tried mixed values, differents element types but no result.
I am new to XSD so I would like to know what is the solution to tell that there can be everything in my nodes ?

Thank you,
Matthéo.


texts: Showing error in console and didnt load checkout page

texts:
[ERROR] Failed to load the "Magento_Tax/checkout/minicart/subtotal/totals" template requested by "minicart_content.subtotal.container.subtotal.subtotal.totals".

in magento show this error and checkout page didnt load still loading how can i fix this


texts:
I have installed varnish in my centos server.

But varnish age is always 0, my guess is it will be 0 because Magento serves content from it's cache or it blocks others to cache.

I can see there are loads of extension available.

However, I want to understand what's going on and how can I achieve this without installing any third party extension.


texts:
I added  script file to view/templates/chat.phtml its not reflect for me,

This is My Layout File view/frontend/layout/default.xml

<?xml version="1.0"?>
<!--
/**
 * Copyright © 2015 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">

    <body>

        <referenceContainer name="tawk.chat">
            <block class="Chennaibox\Tawk\Block\chat"  template="Chennaibox_Tawk::chat.phtml"/>
        </referenceContainer>
    </body>
</page>

This is My Block File:

/**
 * Backend form key content block
 */
namespace Chennaibox\Tawk\Block;

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

}

This is Phtml File: view/templates/chat.phtml

<!--Start of Tawk.to Script-->
<script type="text/javascript">
    var $_Tawk_API={},$_Tawk_LoadStart=new Date();
    (function(){
        var s1=document.createElement("script"),s0=document.getElementsByTagName("script")[0];
        s1.async=true;
        s1.src='https://embed.tawk.to/573e8d5d9ac6de9e4f917161/default';
        s1.charset='UTF-8';
        s1.setAttribute('crossorigin','*');
        s0.parentNode.insertBefore(s1,s0);
    })();
</script>
<!--End of Tawk.to Script-->

chat.phtml file not reflect in front end suggest me how to do this.


texts: Magento 2 - Add Customer Attribute with Select Field

texts:
I'm trying to insert a customer attribute in magento 2

This is the InstallData script:

use Magento\Framework\Setup\InstallDataInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\ModuleDataSetupInterface;

class InstallData implements InstallDataInterface
{
    protected $customerSetupFactory;

    public function __construct(
        \Magento\Customer\Setup\CustomerSetupFactory $customerSetupFactory
    ) {
        $this->customerSetupFactory = $customerSetupFactory;
    }

    public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
    {
        $setup->startSetup();

        $customerSetup = $this->customerSetupFactory->create(['setup' => $setup]);

        $customerSetup->addAttribute(
            \Magento\Customer\Model\Customer::ENTITY,
            'free_catalogue',
            [
                'type'      => 'int',
                'label'     => 'Free Catalogue',
                'input'     => 'select',
                'source'    => \Magento\Eav\Model\Entity\Attribute\Source\Boolean::class,
                'default'   => \Magento\Eav\Model\Entity\Attribute\Source\Boolean::VALUE_NO,
                'required'  => 0,
                'sort_order'=> 99,
                'position'  => 99,
                'system'    => 0,
                'visible'   => 1,
                'global'    => \Magento\Catalog\Model\ResourceModel\Eav\Attribute::SCOPE_GLOBAL,
            ]
        );

        $freeCatalogAttr = $customerSetup
            ->getEavConfig()
            ->getAttribute(
                \Magento\Customer\Model\Customer::ENTITY,
                'free_catalogue'
            );

        $forms = [
            'adminhtml_customer',
            'checkout_register',
            'customer_account_create',
            'customer_account_edit',
            'adminhtml_checkout'
        ];

        $freeCatalogAttr->setData('used_in_form', $forms)
            ->setData('is_used_for_customer_segment', true)
            ->setData('is_system', 0)
            ->setData('is_user_defined', 1)
            ->setData('is_visible', 1)
            ->setData('sort_order', 99);

        $freeCatalogAttr->save();

        $setup->endSetup();
    }
}

After launching setup:upgrade and setup:static-content:deploy the attribute is created correctly in the database, but when I go into admin or frontend, I can not find the field in the customer.
I did not understand, if I configure:

$forms = [
            'adminhtml_customer',
            'checkout_register',
            'customer_account_create',
            'customer_account_edit',
            'adminhtml_checkout'
        ];

I should see the new field in adminhtml_customer, checkout_register ...

Where am I wrong?


texts: SQLSTATE[HY000] [1045] Access denied for user ... (using password: YES)

texts:
I'm trying to install magento 2.1 on the server and in the second step it presents this error:

The data I am putting in is correct, but from this error. When I go through the command line, give me this information:

How do I resolve this issue?


texts:
Yesterday I tried to install a new module in a Magento 2 app and then I ran the di:compile command via CLI I got the "Fatal error: Out of memory" error. The problem is that after that no matter what command I run the system doesn't even start to run the command, it immediately throws the exact same error. I change the php.ini settings and tried to run the commands using the -dmemory_limit directive but it always returns the same exact error in the same class

Example:

 []$ php -dmemory_limit=-1 bin/magento di:compile

Fatal error: Allowed memory size of 2097152 bytes exhausted (tried to allocate 65536 bytes) in /**/vendor/zendframework/zend-modulemanager/src/ModuleEvent.php on line 95


texts:
Are there any reliable ways of disabling the Flash uploader and using the 'classic' uploader? Is this even possible without using an extension?

I'm just normally trying to upload an image via the admin - both /var and /media (and all sub-folders) are set to 777. The response I get back is:

  {"error":"File was not uploaded.","errorcode":666}


texts: Will Data migration tool delete my M1.9 database while migrating to M2.0?

texts:
My M1.9 site is still live and I am building a new M2.x site so I need to migrate my data to the new site.
I wonder whether my M1.9 database will be gone after migration, do I need to back up it using this tool?

Thanks!


texts: Magento 2 : Class Magento\ServicesConnector\Api\ConfigInterface does not exist

texts:
When I'm setting up the Magento system, facing error as

  Class Magento\ServicesConnector\Api\ConfigInterface does not exist
  during

setup:di:compile

Does anyone have Magento_ServicesConnector module?

Using Magento 2.3 open source edition.


texts: " appearing as " in Exported report in xml format

texts:
My Product names contains double quotes ( " ) in their name.
Example product name : Test Product(s) -14 cm - (1.6 mm)-1"-Red
Now when I am trying to export my report in xml format, the name is appearing as Test Product(s)  -14 cm - (1.6 mm)-1&quot;-Red

I have tried code htmlspecialchars before rendering the name, but it is still appearing wrong.

Below are the codes that I have tried

htmlspecialchars_decode($row->getProductName());
htmlspecialchars_decode($row->getProductName(), ENT_QUOTES);
html_entity_decode($row->getProductName());

Please let me know how this can be fixed and if any one faces any similar issue earlier.


texts: Magento 2.2.0 Error : Element 'referenceContainer', attribute 'after': The attribute 'after' is not allowed

texts:
Errors on product  page :

  Exception #0 (Magento\Framework\Config\Dom\ValidationException):
  Element 'referenceContainer', attribute 'after': The attribute 'after'
  is not allowed. Line: 1249

  Exception #0 (Magento\Framework\Config\Dom\ValidationException):
  Element 'referenceContainer', attribute 'after': The attribute 'after'
  is not allowed. Line: 1249


texts: applying free shipping to in stock items only

texts:
How can I create a shopping cart rules that apply free shipping to in stock items only?
in condition settings, I can not find stock item, is there one available to choose from?


texts: Magento 2.2 Command line error after installation

texts:
I have installed fresh magento 2.2 which is working fine but command lines are not working.  I am using ubuntu.

Getting strange error:

  PHP Fatal error:  Uncaught Error: Class 'DOMDocument' not found in /opt/lampp/htdocs/magento2/vendor/magento/framework/Config/Dom.php:384

Did search but not found any solution. As magento 2.2 is successfully installed so it fulfilled all required settings which magento 2.2 required.  What could be the issue?

Any help would be appreciated.


texts: Magento 2 - Cart empty after successful payment

texts:
I have a custom payment method, after successful payment; payment page return to a controller where it updates order status and truncate current cart items like this:

$this->quote->load($orders->getQuoteId());

$this->quote->setReservedOrderId(null);
$this->quote->setIsActive(true);
$this->quote->removePayment();
$this->quote->save();

$this->cart->truncate();
$this->cart->saveQuote();

Where $this->quote is object of Magento\Quote\Model\Quote
and $this->cart is object of Magento\Checkout\Model\Cart

The cart is truncating properly, but the cart summery count is still appearing on header, and when I go to view cart, it is showing empty cart with previous order total, as shown in image below

My question is, how can I fully empty my cart data after successful payment?


texts: Custom Options Not Appearing On Product Frontend on Magento 1.9

texts:
I am required to set custom options on the Magento 1.9 Admin Backend on a product, but the custom options do not appear at all on the product's frontend page on the website, how do I fix this problem? Would I need to edit a Magento file in File Manager on the website for custom options to work? Any help would be appreciated. Thank you.

Backend:

But the Frontend, however:


texts: My Full Page Cache Currently takes ~1 GB Space. My total allotment of the disk is 7 GB. The performance and everything are great, however, I am concerned about disk space. I am using 80% of disk space right now. Is there a possibility to compress the full page cache? as most of it is text, I can save a lot with GZIP compression.


texts:
I want to update monolog/monolog version to ^1.17

I tried to do the same using below commands

composer require monolog/monolog:^1.17
composer update

But it gives below errors.

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - magento/product-community-edition 2.1.5 requires monolog/monolog 1.16.0 -> satisfiable by monolog/monolog[1.16.0] but these conflict with your requirements or minimum-stability.
    - magento/product-community-edition 2.1.5 requires monolog/monolog 1.16.0 -> satisfiable by monolog/monolog[1.16.0] but these conflict with your requirements or minimum-stability.
    - Installation request for magento/product-community-edition 2.1.5 -> satisfiable by magento/product-community-edition[2.1.5].


texts: Change Configurable Swatches Layout for some product

texts:
I'd like to change configurable Swatches layout for a specific product.

I set the Custom Layout Update field on the admin panel:

<PRODUCT_TYPE_configurable>
<reference name="product.info.options.configurable.renderers">
<action method="setTemplate"><template>configurableswatches/catalog/product/view/type/options/configurable/swatches-new.phtml</template></action>
</reference>
</PRODUCT_TYPE_configurable>

But it's doesn't work.

Can you help me?


texts: Abandoned Carts Don't Show in Reports Magento 1.9.2.2

texts:
I have upgraded my Magento CE platform from 1.9.0.1 to 1.9.2.2 and few days ago, I noticed that abandoned carts report is not updated with new carts. Where as I have checked in Customer Edit form, we can see all the items in shopping cart, also they are shown in sales_order_quote in Db, which means carts are being created, but they are not listed in reports.

I have tested it by creating a test customer account, and the problem is same. Any idea where in the code I should look for...?

Thanks


texts: M2: Useful SQL scripts to convert a "production" copy to dev?

texts:
I'm just wondering if people have any useful SQL scripts/queries to "flip" a copy of a production site environment into a development environment?

I actually have my production copied to the development environment by our host, they make a clone copy, and make a few of the base changes to make the development site come up (base url, etc).

Are ALL the base store configurations stored in core_config_data?

Im looking for SQL scripts that people have found useful to quickly re-configure a site for testing. Things like payment methods (Id like to have a script to change them from prod to sandbox mode), store url, cookie setting, etc. I'd like to create/have a sql query to update all of these settings at once, to save a bunch of time.  Luckily, once this script is mostly working, it won't need to change often to continue to be useful.


texts: Display custom massage if user is not logged in!

texts:
I use the function "add to wishlist" in my magento ecommerce web store! if user is not registered and logged in, he is not able to add the product to his wishlist. What I would like to accomplish is to show the message to user that he needs to be registered and logged in, in able to add the product to wishlist. This message should be displayed to user only when he press the button add to wishlist when he is not logged in.

Thanks.

*UPDATED: 24.10.2015 *

so far, i'm using in my view page:

                <?php
                if(!Mage::getSingleton('customer/session')->isLoggedIn()){
                Mage::getSingleton('core/session')->addError('You need to be looged in!');
                }
                ?>

with the above code i get the wanted message, but i'm not able to close the message. Anybody?


texts: Magento Data Migration Tool For Third Party Extension or Custom Modules

texts:
I have done default migration using Data Migration Tool.
Now I want to migrate data of my custom module for that I am following below link:
https://devdocs.magento.com/guides/v2.4/migration/extend-the-tool.html
But, How can I run migrate:data command only for my custom module, As I don't want the command remigrate all data like customers, products, orders etc.
Let me know how can I run it for my custom modules only.


texts: Generate get parameter in XML layout Admin

texts:
I have a custom extension that generate grid using XML, the problem is that I need to add button which will generate link with a get parameter from get request that passed via url, the xml code for button like this look like this:

<item name="buttons" xsi:type="array">
            <item name="sync" xsi:type="array">
                <item name="name" xsi:type="string">sync</item>
                <item name="label" xsi:type="string">Sync All</item>
                <item name="class" xsi:type="string">primary</item>
                <item name="url" xsi:type="string">test_test/test/massSync/post_id/#id</item>
            </item>
        </item>

The button will connect to massSync controller and I need to add the post_id that exist in window current url like this:

http://test.com/admin/test_test/test/index/post_id/1


texts: Magento 2 : Readiness check error during installation

texts: I am getting readiness check error during magento installation.Can any help to fix this issue? Where can I find another php.ini file for command line in xampp? I've read also that this could be something with cron, but it shows that I configured it well.


texts: what is the purpose of php.ini file in magento directory?

texts: There's a php.ini file in magento directory. Does this file overrides the global php.ini settings? I'm making changes in that but they're not reflecting after restarting wamp. Is that a sample file and changes must be made in global php.ini file?


texts: Magento 2 - Failed Authorize.net Transactions Are Not Being Canceled and Not Getting a Response from Auth.net

texts:
I have a pair of sites I manage that are on Magento 2.2.4 and 2.2.5. Both are using Authorize.net Direct Post and I have applied the Authorize.net MD5 patch from Magento to utilize the signature key instead of MD5. Both sites are able to properly process valid cards but failed transactions do not get canceled as expected. This was hit and miss prior to the patch so that might not be related.

I have both sites properly calling the Magento cron on a schedule for every two minutes. Even after the cron has run, the order is not canceled and remains in pending. I have set Direct Post to Authorize & Capture, but that did not have any impact.

The reporting of this transaction to the Merchant has timed out. An e-mail has been sent to the merchant informing them of the error. The following is the result of the attempt to charge your credit card.

This transaction has been declined.

This is what I get as a response from transact.dll. I have Debug enabled for Direct Post so I get logs and I am not receiving a response from Authorize.net. I'm gathering that will be my issue but what would prevent Magento from seeing the response?


texts: Showing % discount on product collection page

texts:
I'm trying to display %age discount on product collection page, following these tutorials:
http://www.pauldonnelly.net/magento-display-sale-icon-if-special-price/
http://shamimcse05.wordpress.com/2010/12/23/get-special-price-or-regular-price-in-magento/

I've declared these in the above code:

$_productCollection=$this->getLoadedProductCollection();
$_helper = $this->helper('catalog/output');

Then i've used this loop to get all the products:

<?php foreach ($_productCollection as $_product): ?>

Under this loop, i'm trying to add these lines, I've tried following the above mentioned tutorials as it is, but they starting giving errors, so i mixed, them up to get rid of errors, and here is what the code has become:

         <?php $specialprice = Mage::getModel('catalog/product')->load($_product->getId())->getSpecialPrice();
            $thisProduct= Mage::getModel('catalog/product')->load(product_id);
            $regularprice = $thisProduct->getPrice();
            // Get the Special Price FROM date
            $specialPriceFromDate = $thisProduct->getSpecialFromDate();
            // Get the Special Price TO date
            $specialPriceToDate = $thisProduct->getSpecialToDate();
            // Get Current date
            $today = time();
            if ($specialprice):
                if($today >= strtotime( $specialPriceFromDate) && $today = strtotime( $specialPriceFromDate) && is_null($specialPriceToDate)):
                    $discount = (($regularprice-$specialprice)/$regularprice)*100 ;
                endif;
            endif; ?>

I'm using the code below to check output:

                echo "Discount is: ".$discount = (($regularprice-$specialprice)/$regularprice)*100 ."% OFF" ;
                echo "
Special Price is: ".$specialprice;
                echo "
Regular Price is: ".$regularprice;
                echo "
Special Price from date is: ".$specialPriceFromDate;

and this is the output on the page for the products, which have been assigned special price, with valid start and end dates:

Discount is: 0% OFF
Special Price is: 500.0000
Regular Price is:
Special Price from date is:

It is getting the values of Special Price, but it is not reading the regular price value,'From Data' and 'To Date'.

Please help me solve this problem.


texts: How can i move desription of magento 2 products outside the main container? ( for landing page)

texts:
I want to make every product page a nice landing page with full width like you can see on one plus 3 website.

https://oneplus.net/3

So i want the products image and the right colum where you buy the product to be fixed. But when you scroll down it's full width. (the long descprition div is full width). Then i can do things like on one plus site.

Problem: Everything is inside the maincontainer which controls the width...

I would like to get it out of it, so i can then do what i want.

I tried css tricks "to make child div bigger then parrent div" without success.

Thanks in advance!


texts: Magento 2: Predefine configuration values in config.php

texts:
I am trying to predefine the values for field in Configuration > Sales > Sales Email
I am not sure how to predefine it & check if it works.
Any thoughts ?


texts: Magento2 : Add new phtml file in Shipping Section of checkout

texts:
I am working on custom extension and want to add phtml file code in shipping section of Magento2 at checkout process.
Can anybody help me with it?
See Screenshot below.


texts: Convert Custom Email To PDF : Magento 2.3

texts:
I Have Custom Module For Send Email.

  But I Want To Send Pdf Same As Email.

  I Want To Convert My Email Template To PDF  And Attach It to
  Email Magento 2.3


texts: How to render two root categories in navigation?

texts:
I have two root categories in the left navigation.
And it should be like this:

default: (root1 - doesn't appear on the view itself)
  - sub1
  - sub2
  - sub3

default1: (root2 - doesn't appear on the view itself)
  - ssub1
  - ssub2
  - ssub3

To show first root category run this code:

<?php $_menu = $this->renderCategoriesMenuHtml(0, 'level-top') ?>

What about second root category? How to make it appear in frontend?

UPDATE 1:

I tried that:

Rewrite class to Mage_Catalog_Block_Navigation

class Company_Catalog_Block_Navigation extends Mage_Catalog_Block_Navigation
{
    //...
}

Add function renderOtherCategoriesMenuHtml to Company_Catalog_Block_Navigation

public function renderOtherCategoriesMenuHtml($otherRootID, $level = 0, $outermostItemClass = '', $childrenWrapClass = '')
{
    $activeCategories = array();

    $categories = Mage::helper('catalog/category')->getOtherStoreCategories(otherRootID);

    foreach ($categories as $child) {
        if ($child->getIsActive()) {
            $activeCategories[] = $child;
        }
    }

    $activeCategoriesCount = count($activeCategories);
    $hasActiveCategoriesCount = ($activeCategoriesCount > 0);

    if (!$hasActiveCategoriesCount) {
        return '';
    }

    $html = '';
    $j = 0;
    foreach ($activeCategories as $category) {
        $html .= $this->_renderCategoryMenuItemHtml(
            $category,
            $level,
            ($j == $activeCategoriesCount - 1),
            ($j == 0),
            true,
            $outermostItemClass,
            $childrenWrapClass,
            true
        );
        $j++;
    }

    return $html;
}

Rewrite class Mage_Catalog_Helper_Category and add custom function:

class Company_Catalog_Helper_Category extends Mage_Catalog_Helper_Category{

public function getOtherStoreCategories($idParent, $sorted=false, $asCollection=false, $toLoad=true)
{

    $cacheKey   = sprintf('%d-%d-%d-%d', $idParent, $sorted, $asCollection, $toLoad);

    if (isset($this->_storeCategories[$cacheKey])) {
        return $this->_storeCategories[$cacheKey];
    }

    /**
     * Check if parent node of the store still exists
     */
    $category = Mage::getModel('catalog/category');
    /* @var $category Mage_Catalog_Model_Category */
    if (!$category->checkId($idParent)) {
        if ($asCollection) {
            return new Varien_Data_Collection();
        }
        return array();
    }

    $recursionLevel  = max(0, (int) Mage::app()->getStore()->getConfig('catalog/navigation/max_depth'));
    $storeCategories = $category->getCategories($idParent, $recursionLevel, $sorted, $asCollection, $toLoad);

    $this->_storeCategories[$cacheKey] = $storeCategories;
    return $storeCategories;
}
}

4.Call renderOtherCategoriesMenuHtml in the view with navigation.

5.Incorrect rewrite urls:

After that you'll get navigation menu but it has incorrect rewrite rules.
I debugged it.
If we take a look at getCategories function in Mage_Catalog_Model_Resource_Category you will see this one:

$tree->addCollectionData(null, $sorted, $parent, $toLoad, true);

This method has some functionality which is set rewrite rules:

class Mage_Catalog_Model_Resource_Category_Tree extends Varien_Data_Tree_Dbp
{
      public function addCollectionData($collection = null, $sorted = false, $exclude = array(), $toLoad = true, $onlyActive = false)
      {
            //...
            if ($this->_joinUrlRewriteIntoCollection) {
                $collection->joinUrlRewrite();
                $this->_joinUrlRewriteIntoCollection = false;
            }
            //...
      }

This function get rules from core_url_rewrite where each request path attitudes to certain webstore. It means that we should create webstore and new store view to get its root category children with correct URL.

Resume:
@RickKuipers is partly right but we shouldn't change webstore while view is being generated.


texts: Magento 2 : Title Prefex and Suffix Doesn't Works

texts:
I have 2 websites with Magento 2.2.2 with luma theme.
For one prefix and suffix works fine. For other, no prefix and suffix are rendering.

Who can explain me exactly where part of the code is used to generate the title I will try to debug it.
Thanks a lot, guys


texts: How do you show image tiles as configurable product option?

texts:
I am trying to get my configurable products set up as shown below.  I have looked all over and unless I'm using the wrong terms I can't see it anywhere.

To confirm at the moment I have a dropdown input option but I want it to show as the above color option.  I presume as magento have this image on their own website no extension will be needed as they haven't mentioned it in the guide.

Thanks.


texts: Magento 2: system.xml saved config validation

texts:
I developed an extension for Magento2 that saves configs using a system.xml and I would like to validate the values the user inputs.
How can i validate those values?


texts: URL Redirects -- Amazon Platform to Magento

texts:
Our company recently switched from the Amazon Ecommerce platform to Magento. The developers we hired did all 301 redirects to our new homepage versus directing to the specific product or categories, which is hurting our SEO rankings. I do have a list of the old URL's that we were ranking for, however I cannot figure out how to retroactively redirect our old site which is no longer active to our new site on Magento. And I am not sure how redirecting would affect the initial 301 redirects. Any advice would be greatly appreciated!
Thank you,
Jacklyn


texts: Upgrade from 1.9.2.4 to 1.9.3.6 and have blank pages

texts:
I did an upgrade by installing a fresh 1.9.3.6 and then copied back my core files. Now i have a blank page and cant see any errors which make me think it is nearly there.
I looked in the server logs and found
mod_fcgid: stderr: PHP Fatal error: Uncaught Error: Function name must be a string in /var/www/vhosts/xxxxxxx/app/code/local/Mage/Core/Model/Layout.php:555
mod_fcgid: stderr: Stack trace:
mod_fcgid: stderr: #0 /var/www/vhosts/xxxxxxxxx/app/code/local/Mage/Core/Controller/Varien/Action.php(390): Mage_Core_Model_Layout->getOutput()
mod_fcgid: stderr: #1 /var/www/vhosts/xxxxxxxx/app/code/core/Mage/Adminhtml/controllers/IndexController.php(82): Mage_Core_Controller_Varien_Action->renderLayout()
mod_fcgid: stderr: #2 /var/www/vhosts/xxxxxxxxx/app/code/local/Mage/Core/Controller/Varien/Action.php(418): Mage_Adminhtml_IndexController->loginAction()
mod_fcgid: stderr: #3 /var/www/vhosts/xxxxxxxx/app/code/local/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch()
mod_fcgid: stderr: #4 /var/www/vhosts/xxxxxxxxxx/app/code/local/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match()
mod_fcgid: stderr: #5 /var/www in /var/www/xxxxxxxxxx/app/code/local/Mage/Core/Model/Layout.php on line 555
I realize this is an old version but I wanted to get it to a newer 1.9 version then make the jump to v2.
The PHP version is 7.4.


texts: Magento 2: display recently viewed product on product detail page

texts: I want to display recently viewed products on the product detail page with slider.


texts:
I want to add a button to the order view called "Print label" and when clicked it will generate and download a text file. So here is the steps I think I should do:

Create button: How do pass order id + use urlbuilder to make a link?)
Create a controller that genereates the file (I am familiar with making controllers)

I have already added a button (and a controller) to the sales order grid for another purpose but do not know how to add one to the sales order view:

Vendor/Module/etc/adminhtml/di.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Backend:etc/menu.xsd">
    <menu>
        <add id="Vendor_Module::packinglist" title="Packinglist" module="Vendor_Module" parent="Magento_Sales::sales_operation" action="packinglist/packinglist" resource="Vendor_Module::packinglist"/>
    </menu>
</config>

I have tried this guide but I do not know how to make a link and Ithink I rather us above method to add a button.


texts: 1.9.2 Catalogue Price Rules rounding (when more then one rule applied with 'Stop further rules..')

texts:
In some cases of catalog price rules i have noticed, that the final price after rule being applied is rounded incorrectly.

Example:
Nett Price for one unit: 22.67 EUR
Rule: 50% of original price

Final price: 11.000
It should be:11.335

Changing rule to 47%

Final price: 12.000
It should be 12.0151

This rule is applied to 2 categories, some products are ok, some with above problems, I can’t find the clue.

IMPORTANT the problem occur if more than one rule is applied for the same product, even if they have "no further rule processing" enabled.

Any ideas? I assume the problem is with the "stop further rule processing".

If it is limitation to community edition, please let me know at least.


texts: Reindex data by exec shell command root file goes 504 Gateway Time-out

texts:
I have tried with below script

set_time_limit(0);
error_reporting(E_ALL | E_STRICT);
require_once 'app/Mage.php';
umask(0);
ini_set('display_errors', 1);
Mage::app('en');
Mage::getSingleton('core/session', array('name' => 'adminhtml'));
$indexer="shell/indexer.php";
if(file_exists($indexer))
{

                $idxlist=array("catalog_product_attribute",
                               "catalog_product_price",
                               "catalog_product_flat",
                               "catalog_category_flat",
                               "catalog_category_product",
                               "catalog_url",
                               "catalogsearch_fulltext",
                               "cataloginventory_stock");
        //reindex using magento command line
        foreach($idxlist as $idx)
        {
            echo "reindex $idx n ";
            exec("php shell/indexer.php --reindex $idx");
        }
}

Since my store has more than 3000 products,After ran this script from root folder,it goes 504 gateway timeout error. Any possibility to print the output with out time error ?

Please advice


texts:
Since upgrading to 2.4.2 I've noticed some strange behaviour after clearing cache and static files. Try it: clear the cache and static files then login to the dashboard. The page loads with the loading spinner then nothing. Check the console log and you'll find a load of JS scripts missing. Wait a bit and refresh and the page finally loads correctly. Try the same on say products - that takes three refreshes and a minute or more before the products finally load.
Same happens on front end: scripts are not there, wait a couple of minutes and refresh and the scripts appear.
The site is on the same (dedicated cPanel) hosting as previous 2.3.3 version but now on PHP7.4. Never saw this behaviour on any previous versions.
Before anyone suggests running setup:static-content:deploy, this is the dev site and this should not be run in developer mode. In dev mode, only necessary static content is (should be!) generated on the fly.
Anyone else noticed this and have a view on what's happening?


texts:
I want to optimize magneto store.

Magento store is deployed on Aws. I have not installed SSL certificate yet because It is still in development phase so I have not mapped it with domain name it is an IP address
I have enabled default minify , merge and bundle JS &CSS , done with all necessary steps like optimize images , enable flat category , enable g-zip compression After perform all steps my loading is reduced from 14 seconds to 6 seconds but I want to optimize it more to 3 seconds at least???

Also before enabling merge ., minify and bundle JS the total number of requests were 224 so I decided to enable it and it is reduced to 24.


texts:
How to do Magento 2 payment method based on customer group in frontend checkout page .

Iam checking condition for Remaining Amount

But i want customer group also , if

Customer group=4 then only its should display

if($creditdata->getRemainingAmount()<$paymentamount)

      return false;

        else

            return true;

Thanks in advance.

This is my code ....

<?php

namespace Ced\CreditLimit\Model;

class CreditPaymentHide extends \Ced\CreditLimit\Model\CreditPayment

{

    public function isAvailable(\Magento\Quote\Api\Data\CartInterface $quote = null)

    {
        $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
        $checkoutdata = $objectManager->create('Magento\Checkout\Model\Cart');
        $customer = $objectManager->create('Magento\Customer\Model\Session');

        if(!$objectManager->create('Magento\Framework\App\Config\ScopeConfigInterface')->getValue('b2bextension/credit_limit/enable')){
        return false;
      }
      if($customer->isLoggedIn())
        {
            $creditdata = $objectManager->create('Ced\CreditLimit\Model\CreditLimit')->load($customer->getCustomerId(),'customer_id');

        $discountTotal =0;
            foreach ($checkoutdata->getQuote()->getAllItems() as $item){
                $discountTotal += $item->getDiscountAmount();
            }
            $total = $checkoutdata->getQuote()->getBaseGrandTotal();
            $paymentamount = $total-$discountTotal;
            if($creditdata->getRemainingAmount()<$paymentamount)
                return false;
            else
                return true;
        }
        else{
            return false;
        }
    }

}


texts: Load a category collection with store-specific data

texts:
I have found plenty of questions and answers regarding how to load categories from a particular store, but this is a different issue.

My problem is, having loaded the categories that I want, their attribute data is always the default / global value.

Mage::getModel('catalog/category')->getCollection()
    ->addAttributeToSelect(array('name', 'description')
    ->addAttributeToFilter('is_active', 1)
    ->addIdFilter('31,32,33,34') // has to be a string, array doesn't work!
    ->setStoreId(2);

In the above example, the names and descriptions that I get back are the default values, not the ones set for store ID 2. It looks like setStoreId does nothing.

I know that the categories themselves are not connected with a particular store view, but the attributes are: in the admin panel, you can set values per store view, per website and globally. I've set them per store view.

I've tried ->addStoreFilter(2) but Mage_Catalog_Model_Category_Collection doesn't support that, I get a PHP fatal error. Looks like it's a product-specific filter.

Does anyone know what I'm missing?


texts: Magento 2 CityId does not have corresponding setter?

texts:
I have created an customer address attribute city_id while i am trying to add this attribute in the below following REST APis Getting bellow error.

  Property "CityId" does not have corresponding setter in class
  "Magento\Quote\Api\Data\AddressInterface"**

POST /V1/carts/mine/estimate-shipping-methods
POST /V1/guest-carts/:cartId/estimate-shipping-methods

How can we solve? please help me.

thanks


texts: Magento2 : Display percentage of discount on product list and view page

texts:
I want to display discount in percentage format on product list and product view page as like below

30% Discount

How I can achieve this task in proper Magento-2 way.

Code should be define in any one place and use it in anywhere.

thanks in advance.


texts: add custom attribute for customer in magento 2.3 using db schema

texts:
how I can add a custom attribute for customer

  using DB schema in Magento 2.3

  does anyone is already tried

  Just help me?


texts: How do I Create one Magento Product with 40 different types of Fabrics to choose from?

texts:
What would be the best way to configure one product (a handbag) where you can have 40 different types of fabrics to choose from?

If I do this with Configurable Swatches, the page load time would be terrible because of all the images, right?

If I use Custom Options with a drop down, where do i put all those images?

Please could anybody advise what would be the best way to do this?

Thanks a lot!


texts: How to validate shipping address per product by city and restrict user

texts:
I am using Magento 1.9 .
I want to create product and make available in only specific cities. And also I want to restrict users on checkout when they select product to ship in the city where the product is not available.

What I have in mind so far is, it will be good to create an attribute named 'city', make it multiselect and add cities as it's options. So now I can create product and assign multiple cities to it. and can be seen at the 'Additional Information tab' on frontend product's page.

But now I want to restrict user if he select orders product available in "New York" and he submitted shipping address with any other city. This should restrict the further process and display message.
My attribute for cites:
My attribute above with options.
And on product's backend page:

In short, I want to restrict user on checkout and display message. "The product is not available in the specified address/city/location etc"


texts: Magento 2.2.4 particular page cache disable using the observer OR any other method

texts: I want to create observer for particular page cache disable.


texts: adding a field to the new order customer select grid

texts:
I want to add the company name to the grid for when you make a new order in the backend and have to select the customer you make the order from.

Only i can find nothing on how to add anything to this grid as it is not commenly edited.

I would like to know how to add a field to this grid but dont know how to.


texts: Custom cache does not gets cleaned from admin cache management

texts:
I am trying to clear custom created cache from Admin, but it does not work.
is their any way to make it work ?


texts:
My mage log is not working.

I am using magento 1.9. I am also using wamp server so permission issues should not arise for the var folder.

I first went to  System > Configuration > Developer and switch on logging

I then placed the following Mage log at this location:

app\Mage.php

 public static function run($code = '', $type = 'store', $options = array())
 {
    Mage::log('work');
    Mage::log('My log entry', null, 'mylogfile.log');
 }

I then refreshed my home page but nothing came up with the log files.

Is there something that I am missing?

I checked the permssions folder for my VAR and its :

drwxr-xr-x 1 theSeeker  197609   0 Sep 26 08:49 log/


texts: Create custom script to update product_options column in 'sales_order_item' table from another table

texts: Need help to create custom script to update product_options column in 'sales_order_item' table in Magento2 from another table of named 'live_giftcards_card'


texts: Is it possible to append a system configuration to existing configuration section group via a custom module

texts:
I've tried to add a configuration item to sales/carriers/fedex in my custom moduel, but seems not work

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
    <system>

            <group id="fedex" type="" sortOrder="60" showInDefault="1" showInWebsite="1" showInStore="1" translate="label">
                Fedex test append
                <field id="test" translate="label" sortOrder="1" type="select" showInDefault="1" showInWebsite="1" showInStore="0">
                    Enabled
                    <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
                </field>
            </group>

    </system>
</config>

Are there any ways to do that?


texts:
suppose I need to add following changes in my css:

.border{1px solid #cecece}
.box{float:left}

I am stucked to add these in my styles, i can only see .less files and not sure how it works.


texts: Magento 2 - How to add captcha to a custom form

texts: I'm developing a custom module which contains a form submission. I would like to add a captcha to it. And we want to use the Magento default captcha library so that the captcha is consistent with the one in registration form.


texts: How Can i call ui component grid using php in magento 2

texts:
is it possible to call UI component grid in phtml using php like calling block

Thanks


texts: Magento 2: Update Minicart Product Price

texts:
I would like to update Minicart Product's price.

I need all parameters so we can update it.

It should update automatically Grand & Sub Total or We need to Update as well?


texts: Configure different store views on single website - magento

texts:
I am trying to create three store views in single magento website.Named as US, UK and saudi arabia.

Each store view is differ from  language and  currency of other store views. But catalog and customers are same.

Some of the magento developers were told, Which is impossible to setup different languages and different currencies on different store views within same website. It is only possible to create different websites.

Simply my problem is, when US users visit my website, page content should be shown as English language and currency should be  mentioned as US dollar. And when Saudi Arabia users visit my website, page content should be changed into Arabic language and currency should be changed into Saudi Riyal. IS it possible?


texts: Integrating Magento2 and Wordpress on different servers

texts:
Im looking into integrating Magento2 with Wordpress.
Most importantly, Id like the wordpress site to have the same header and footer as the Magento site. Ideally, Id like my marketing team to easily show Magento products on the Wordpress Blog.

I have seen many plugins or code that could solve this.

However, the Wordpress and Magento are on different servers.

I am very familiar with Wordpress, I am just now learning Magento.
Any help would be appreciated.


texts:
How do I change not using ObjectManager directly? and use Dependency injection? what about my SQL query? My code is work, but seems not in good Magento style, anyone can help to correct me? I am appreciate if anyone can help
<?php

declare(strict_types=1);

namespace ABC\Fixpayment\Cron;

use Magento\Email\Model\BackendTemplate;
use Magento\Framework\Mail\Template\TransportBuilder;
use Psr\Log\LoggerInterface;

class Check
{

    private $logger;

    private $transportBuilder;

    public function __construct(
        LoggerInterface $logger,
        BackendTemplate $emailTemplate,
        TransportBuilder $transportBuilder
    )
    {
        $this->logger = $logger;
        $this->transportBuilder = $transportBuilder;
        $this->emailTemplate = $emailTemplate;
    }

    public function execute()
    {
        //Cron job - get sales_order_payment information by below query.

        $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
         $resource = $objectManager->get('Magento\Framework\App\ResourceConnection');
         $connection = $resource->getConnection();
         $tableName = $resource->getTableName('sales_order_payment');
         $attribute_information = "SELECT sales_order.increment_id, sales_order_payment.additional_information
            FROM sales_order LEFT JOIN sales_order_payment ON sales_order.entity_id = sales_order_payment.parent_id
            WHERE sales_order_payment.method = 'fixpayment' AND sales_order.updated_at >= NOW() - INTERVAL 30 MINUTE";

        $results = $connection->fetchAll($attribute_information);

// Fetch sql query result

    foreach ($results as $result) {
            $increment_id = $result['increment_id'];
            $additional_information = $result['additional_information'];
            $additional_information_arr = json_decode($additional_information);
            $address_verification_json = $additional_information_arr->shipping_address_verification;
            $address_verification_arr = json_decode($address_verification_json);
            $postal_code = $address_verification_arr->postal_code;

        //Grab Postal Code, if score lower than 1, email to customer support

        if ($postal_code < 1) {

            try {
            $templateVars = [
                            'order_number' => $increment_id,
                            'postal_code_score' => $postal_code,
                            'fixOrderId' => $additional_information_arr->fixOrderId
            ];
            $emails = ['receiver@gmail.com'];
            $email_template = $this->emailTemplate->load('fix_temp', 'template_code');
            $email_template_id = $email_template->getTemplateId();
            $transport = $this->transportBuilder->setTemplateIdentifier($email_template_id)
            ->setTemplateOptions( [ 'area' => \Magento\Framework\App\Area::AREA_FRONTEND, 'store' => 1 ] )
            ->setTemplateVars( $templateVars )
            ->setFrom( [ "name" => "Magento Fix Order", "email" => "sender@gmail.com" ] )
            ->addTo($emails)
            ->setReplyTo('sender@gmail.com')
            ->getTransport();
            $transport->sendMessage();
            } catch (Exception $e) {
                $this->logger->error($e);
            }

        }

    }

    }

}


texts: Orders grid, display [ deleted ] in Purchased from (store)

texts:
I removed some stores and now when I see the dropdown "Purchased from (store)" in Sales -> Orders ->Grid I found the deleted option. I remove every relationship between the stores deleted and orders but the  deleted  option still shown.

Someone knows how to remove this option?


texts: Custom Module depends on a specific version of another module?

texts:
Let's say I have 2 modules Foo_BarA and Foo_BarB. We could declare Foo_BarB's dependency on Foo_BarA in app/etc/modules/Foo_BarB.xml like this:

<config>
  <modules>
    <Foo_BarB>
      <active>true</active>
      <codePool>community</codePool>
      <depends>
        <Foo_BarA/>
      </depends>
    </Foo_BarB>
  </modules>
</config>

But is it possible to specify the minimum required version of Foo_BarA as well, in Foo_BarB.xml?

e.g. something like this maybe?

<config>
  <modules>
    <Foo_BarB>
      <active>true</active>
      <codePool>community</codePool>
      <depends>
        <Foo_BarA>
          <version>2.0.1</version>
        </Foo_BarA>
      </depends>
    </Foo_BarB>
  </modules>
</config>


texts: Where is the js script written for selection of attributes in magento 2

texts:
I am unable to find one ajax script .
Can any body tell me where is the script written for this page https://prnt.sc/szvwqu
On selection of attributes , how the price gets changed ? where can i find the script for this?


texts:
Recently I've met this problem, looking for solution, seems like a cache/cookies problem. Customers often have this issue and after click "Add to cart/basket".

Magento displays message "Shopping Basket is Empty"

Any ideas what can cause this issue ?


texts: Show pricing including or excluding tax based on the customer group

texts:
I know that displaying a product price including/excluding tax can be set globally under System->Configuration->Sales->Tax. Is there a way to be more specific, depending on a Customer Group?

Generally I want all prices to display including Tax, but have a Trade Group that need to show prices excluding tax.

I am very green to Magento and by no means 'good' at customising xml, so an idiots guide would be appreciated.

Thanks


texts: Changing shipping methods depending on products in cart

texts:
I want to change shipping method depending on products present in the cart.
There are different weights assigned to products.
If all products present in the cart are of less than 5 k.g (weight for each product) then one shipping method will display.

If any one product in the cart, has weight greater than 5 kg. then show another shipping method.


texts: Add a link to Magento Admin for the Media Library

texts:
I would like to add a link to the CMS menu on the Magento Admin panel for the Media Library, just under the polls link.

to link to...

I tried creating a module with the below adminhtml.xml

<config>
    <menu>
        <cms>
            <children>
                <medialink translate="title" module="cms">
                    <title>Media Library</title>
                    <action>adminhtml/cms_wysiwyg_images</action>
                    <sort_order>100</sort_order>
                </medialink>
            </children>
        </cms>
    </menu>
    <acl>
        <resources>
            <admin>
                <children>
                    <cms>
                        <children>
                            <medialink translate="title">
                                <title>Media Library</title>
                            </medialink>
                        </children>
                    </cms>
                </children>
            </admin>
        </resources>
    </acl>
</config>

This only succeeds in adding the link to the menu, the <action>adminhtml/cms_wysiwyg_images</action> does not work as I'd hoped.  The link directs the user to a broken page, not the proper media library.

UPDATE

Looking more closely at the ajax calls in the browser when you open the media library I see MediabrowserUtility.openDialog is called from /js/mage/adminhtml/browser.js.  Although browser.js is not loaded on the dashboard.


texts: Security patch 5994 (admin disclosure) not installed (magereport)

texts:
I am install Security patch 5994 and it install successfully but in magereport they say Security patch 5994 (admin disclosure)  not installed

applied.patches.list

2016-12-09 05:49:57 UTC | SUPEE-5994 | CE_1.6.0.0 | v1 | _ | n/a | SUPEE-5994_CE_1.6.0.0_v1.patch
patching file app/code/core/Mage/Authorizenet/controllers/Directpost/PaymentController.php
patching file app/code/core/Mage/Core/Controller/Varien/Router/Admin.php
patching file app/code/core/Mage/Core/Controller/Varien/Router/Standard.php
patching file app/code/core/Mage/Customer/Model/Customer.php
Hunk #1 succeeded at 259 (offset -14 lines).
patching file app/code/core/Mage/Dataflow/Model/Convert/Parser/Csv.php
patching file app/code/core/Mage/ImportExport/Model/Export/Adapter/Csv.php
patching file app/code/core/Mage/Install/Controller/Router/Install.php
patching file app/code/core/Mage/Install/etc/config.xml
patching file app/code/core/Mage/Sales/controllers/Recurring/ProfileController.php
patching file downloader/Maged/Model/Connect.php
patching file downloader/Maged/View.php
Hunk #1 succeeded at 152 with fuzz 2 (offset -10 lines).
patching file downloader/template/connect/packages_prepare.phtml
patching file downloader/template/messages.phtml
patching file get.php
patching file lib/PEAR/PEAR/PEAR.php
patching file lib/PEAR/PEAR/PEAR5.php
patching file lib/Varien/Io/File.php


texts:
Somewhere on my website the following file is loaded: data:application/font-woff;base64....

I want to remove this file, but I can not find out in what specific file it is loaded.

Is there an easy way to find this out in Magento?


texts: Magento 2.2.6 - Attributes Issue with Store View and product created by REST

texts:
I have a product created in M2 and I create a new product attributes, and when we make an update with c# app using REST Call.
In this case the new added attributes are empty in edit product page with "Store View" configured on "All Store Views".
But when I switch to "Default Stotre View" we get values in those fields.
The problem is when I delete this product and I recreate it with REST Call, I haven't those empty attributes.(that's work correctly)

I don't know if that's normal or not in Magento or how to fix that?

this is some snapshot to explain my issue:

In catalog product page those fields have values

when I edit this product on all Store Views mode, the new attributes are empty

now I switch to Default  Store View

And now in Default Store View, we have our values


texts:
I am using Magento 2.2.6 and I have some issue on checkout.
we are using auth.net direct post with the recent patch applied.
Initially it did work fine but since last two day we keep getting this error https://www.screencast.com/t/F6AsugPcDUi6. I debug a lot and found that when I keep Payment Mode Authorize and Capture , it is giving me this error . If I change it to Authorize only ,it allows to place order successfully.  When I check exception log it shows following error

[2019-03-16 19:22:53] main.CRITICAL: Invalid amount for capture. {"exception":"[object] (Magento\\Framework\\Exception\\LocalizedException(code: 0): Invalid amount for capture. at html/vendor/magento/module-authorizenet/Model/Directpost.php:262)"} []

Has any one face similar issue ? Can this be related to recent auth.net patch ?

Other issue is sometimes the checkout page keeps loading forever. Hosting company found it might be related to google analytics script and use might have blocks ads , I am not sure if this is the case for all customer who face this issue . Has anyone found similar issue ?


texts:
I'm trying to move the top navigation to the left column of the page. Unfortunately I don't really know how I can manage this.

Since I have a lot of categories, I can't really use the Horizontal Navigation.

I have already tried changing the catalog.xml file, but it didn't seem to work. Cache is disabled, and its a clean install.

Thanks in advance!

I changed this:

<reference name="left_first">
    <block type="catalog/layer_view" name="catalog.leftnav" after="currency" template="catalog/layer/view.phtml">
        <block type="core/text_list" name="catalog.leftnav.state.renderers" as="state_renderers" />
    </block>
</reference>

to this

<reference name="left">
    <block type="catalog/layer_view" name="catalog.leftnav" after="currency" template="catalog/layer/view.phtml">
        <block type="core/text_list" name="catalog.leftnav.state.renderers" as="state_renderers" />
    </block>
</reference>

Unfortunately nothing changed. The path is: /magento/app/design/frontend/rwd/default/layout


texts:
I need to create a CMS page that will update information at specific times. E.g.: If now is 1pm, the page will display information X. If now is 2pm, the page will display information Y.

I created a PHP file with this code echo Mage::getModel('core/date')->date() that returns my current date and time, but if I try to call this via AJAX to update my page, I got a "Forbidden error".

I read that to call PHP file using AJAX in Magento I need to create a new module (references here and here), but since I never created a module before and this page will be used just for 1 day; I don't think is worthy creating a new module (I am assuming would take me some time to do that).

Any ideas of how I could dynamically get my Magento time zone to use in an HTML page?


texts: Get Product Attribute Value for Dropdown Without Loading the Whole Product

texts:
Been using this snippet to retrieve the attribute values but this only works for input type text or boolean but not for dropdown type of attributes:

$_resource = Mage::getResourceSingleton('catalog/product');
$_resource->getAttributeRawValue($_productId, 'color', Mage::app()->getStore());

For the select dropdown type, it returns bool(false) and I am expecting it would return the dropdown frontend value/label.

How can I get the attribute value of a product without loading the whole product model?

Thank you.


texts: Newly added products not showing as first in category

texts:
This might've been asked before, and I'm kind of sure it was. But unfortunately, I did not succeed to find the answer to this.

I'm deeply sorry.

So let's get to the question.
We've been working with Magento for several years. Now, we've stubled across a problem.
When we add products to our Magento webshop, it used to appear as first product in de category. It was sorted from newly added to old.

Now, in Magento 1.9.1.1 and 1.9.0.1 it appears that it is not doing it like this anymore.

So how can I change this? I have seen that you can change a product's position within the category, but if I added a new product, it means I have to reposition every other product.

I know there are plugins/extensions for this. But there must be another way, right?

I would love to know! Feel free to ask for more info!


texts:
I am using Magento 2.1.0,  and i am trying to change the group Id for my custom module for Registration.

I tried with

<input type="hidden" name="group_id" id="group_id" value="2" />`

and

$customer->setGroupId($this->getRequest()->getParam('group_id'));

but its not work


texts: Magento CSS files not loading with https url

texts:
I have installed SSL certificate and now when I access the website link to secure website  CSS files are not loading.
CSS files are loading in not secured url . Also url links inside the website returning 404:

Please help me solve this issue.
I tried to deploy but that did not help.


texts: How Service Workers can speed up the store?

texts:
It may be useful to introduce service workers to increase loading speed? If yes, which resources are the high priority ones?

Link to Service Workers docs : https://developers.google.com/web/fundamentals/primers/service-workers/


texts:
A module usually contains a routes.xml file which, as I understand it, specifies the routes which the module handles.

I would like to know how routing is handled for the home page, for example for the sample data Luma theme home page. I haven't been able to find a corresponding route, for example in magento/modules-cms, which does list "CMS Home Page" (cms_index_index) in its page_types.xml as a page type that it handles.

Whatever the routing mechanism, I would like to know how it connects route '/' to cms_index_index.

(Related question: How does Luma theme home page work?)

Edit for focus:

I have read the official docs and several blog posts about how routing works in Magento 2 in general. In brief, by consulting all routers which get their match patterns ultimately from routes.xml files.

But the home page seems to be a special case. So the question boils down to:

Where is the special-case code or configuration that detects a route of '/', or possibly '' (if slashes get removed), and ultimately translates that to a page type of cms_index_index?


texts: Google sends parameters like utm_source, utm_campaign, etc ... I would like to know how I get these parameters in magento because I would like to add a custom condition in price rules, check if utm_source is = partner if yes, apply discount.


texts: We need to be able to sort by product. Is it possible to create a report or view that allows a list of all the customers who ordered a specific product?


texts: Magento 2 How to get list of filter for current category using REST API

texts: How to get a list of filters to show on the category page to allow the customer to filter on products using REST API in Magento 2


texts: Magento 2 Angular js error while run setup

texts:
I am new to Magento, I am trying to set up Magento with ddev. So, Downloaded setup version 2.3 with sample data. When I run the setup it shows AngularJs errors in the console (See the screenshot).

Also, it hangs the chrome tab, needs to restart the browser.

Can anyone help?


texts: Magento : Copy Custom Option Value From Order Item to Cart Item

texts:
My product has custom option type file, and I successfully place an order with file attached to my product, I want to do reorder only for custom option type file value, is it possible to copy custom option value from order item to cart item?

my phtml code:

<input id="logo<?=$data['option_id']?>"class="input-logo" name="options_<?=$data['option_id']?>_file" type="file"/>
<input style="display:none;" value="save_new" name="options_<?=$data['option_id']?>_file_action" type="text"/>

my add to cart code:

$params = array(
            'product' => $product->getId(),
            'qty' => 1,
            'form_key' => Mage::getSingleton('core/session')->getFormKey(),
        );

$request = new Varien_Object();
$request->setData($params);
try {
   $cart->addProduct($product->getId(), $request);
   $cart->save();
} catch (Exception $e) {
   Mage::getSingleton('core/session')->addError($e->getMessage());
}
Mage::getSingleton('checkout/session')->setCartWasUpdated(true);


texts:
I am using the Land Of Coder Image gallery extension and when I click on an image, it opens a larger version of the image which is what we want. However, I also want to add a button to the bottom right or somewhere within the fancybox to view the particular product that would then open the product page in a new window.
I was wondering if anyone has done this before? Very similar to
https://fancyapps.com/fancybox/3/quick_view_1.jpg
thank you


texts: Apply Stylesheet From Frontend Skin Folder To Admin Page Via A Layout Handle

texts:
I am looking to apply a stylesheet located in the skin/frontend/default/mytheme/css folder to a page inside the admin area of Magento. See the layout XML I am using to add this stylesheet to the admin page below:

<my_custom_admin_layout_handle>
        <reference name="head">
            <action method="addItem">
                 <type>skin_css</type>
                 <file>css/my-custom-stylesheet.css</file>
            </action>
        </reference>
</my_custom_admin_layout_handle>

The code does add the stylesheet link tag to the page but references the href as skin/adminhtml/base/default/css/my-custom-stylesheet.css. See link tag added to page below:

<link rel="stylesheet" type="text/css" href="/skin/adminhtml/base/default/css/personalshop.css" media="all" />

Is there a way that I can get the stylesheet href to reference the stylesheet in the folder skin/frontend/default/mytheme/css using the layout handle above?


texts: Products are not being sorted correct and import file are missing the first zero

texts:
I have created a new attribute which is going to help sort our products in the search, but when it comes to sorting the attribute by number it seems to only be taking in the first number for example i imported these numbers

SKU    -   Attribute number

0125   -     999

0126   -     78984

0127   -     89

0128    -    998

Then when i sort by attribute number it puts them in this order

SKU  - Attribute number

0125  -  999

0128 -   998

0127  -  89

0126  -  78984

which as you see isnt correct the sku 0126 should be at the top followed by 0125 then 0128 then 0127.

So i tried a new method of giving them all the same length number ( a 4 digit number)
however when i go to important the .xml file or the .csv file it is missing the first number because it is a zero

for example

Imported 0123 but when i look in the back end it display as 123 and i have to add the zero manually, is there a way round this as we have over 5000 products so i cant sit here and add a zero on all my products

How can i either get it to sort the product in the correct order and not go just by the first digit, or get the Zero to appear when i import a csv or xml file?

If you need for information or screenshots let me know.

Thank you


texts: What's the location of the field descriptions mentioned in the documentation?

texts:
where can I locate the "field descriptions" referenced in the documentation under event creation?

http://docs.magento.com/m2/ee/user_guide/marketing/event-create.html


texts: How to show a menu on customers account conditionally?

texts:
I have created a custom menu on customer account. I want to show the menu only when a specific customer attribute value is set. I am not able to find out whether there is any way to show the menu conditionally in Magento2?

To show the custom menu, I am using this in view/layout/frontend/customer_account.xml

<referenceBlock name="customer_account_navigation">
    <block class="Magento\Framework\View\Element\Html\Link\Current" name="customer-account-customfield-index-link">
        <arguments>
            <argument name="path" xsi:type="string">mymodule/customfields</argument>
            <argument name="label" xsi:type="string" translate="true">Identity Proof</argument>
        </arguments>
    </block>
</referenceBlock>


texts: Products are not showing in frontend in Magento 2.4.1

texts: I have installed 3 fresh magento 2.4.0 in server with elasticsearch as a separate container. I have created products in all 3 magento websites. But products are not showing up in frontend. Products are showing only after reindexing. Can anyone please help me on this issue?


texts: How to add 'Insert Widget' functionality to category WYSIWYG editors in Magento 2 ?

texts:
Regarding Magento 2,

I want to add 'Insert Widget' button on category WYSIWYG editor. For more information please find attached screen shots.

cms_insert_widget.png -- I want functionality like this.

category_description_widget.png -- Where i want this functionality.


texts: After deploying Magento 2, I am getting a persmissions error for static/pub

texts:
I am in developer mode, and have ran php bin/magento setup:static-content:deploy to deploy a custom CSS file. I am now getting this error when loading my website:

1 exception(s):
Exception #0 (Magento\Framework\Exception\FileSystemException): The path "_requirejs/frontend/AZ/az/en_US/requirejs-config.js:///home/xxx/public_html/xxx/pub/static/home/xxx/public_html/xx/pub/static/" is not writable

I have changed the permissions of pub and static to 777.


texts: Install Module in Magento 2.2.x without using CLI

texts:
I tried the system() ex.( system(php bin/magento setup:upgrade) ) function of PHP to execute the CLI command of Magento, but no luck.
Is there any other way? It is very hassle to use Flush Static Files Cache in Admin Panel just to apply the CSS or JS I added. We are using shared server, that means there is no SSH Account provided to us.


texts: Magento 2 V1/carts/mine/totals API getting Old data

texts:
In magento 2, after add to cart or merge cart when i am call V1/carts/mine/totals API first time it send me old data. After i am calling same API it give me right data that available in Quote table.

anyone have idea why this happen ?


texts: Magento2 | Docker files permissions on Windows volume

texts:
I'm trying to set up correctly a magento2 project with Docker on Windows 10 and I'm mounting 2 volumes (one with magento2 files and one to save db files).
When I'm trying to get in the admin dashboard in Magento2, there are some bugs because files are not loaded correctly.

What I'm doing :
Run docker-compose up. I have to uncheck docker shared drives before to run docker-compose up else i'm getting an "mount volume already exists" error.
I'm getting issue also with bin/magento cache:flush or bin/magento setup:upgrade : Magento can't delete some files (No such file or directory)
I'm getting issue also with the front  : the application can't find ou modify Interceptor.php.

Please note as I'm on Windows and mounting a Windows volume, so change chmod or owner won't fix the issue. Directory and files are mounted with chmod 755 as root:root and you can't change this (https://docs.docker.com/docker-for-windows/faqs/#volumes).

After searchs; there is something locking files as you can check in the Windows computer management :

Infos :
Windows : Win 10 Pro 17134.165
Magento : 2.2.5
User apache : www-data
User php-fpm : root

I have already done (and the issue is still there) :
run php as root (with php-fpm)
Settings Administrators Hyper-V and docker-users on my local machine (https://github.com/docker/for-win/issues/868)

Can you please tell what I'm doing wrong and why I'm still getting this issue ?