texts: I have a wordpress site that I would like to add a Magento store to

texts: I have an existing wordpress site with a magento instance in a subfolder named /shop. When I type in my address and add /shop to the domain it just routes back to the wordpress site. However when I had an index.html to the magento instance it serves up my test content. Is that in htaccess? I just want to add a store to an existing blog site.


texts: I am trying to override multishipping.php file in vendor/magento/module-multishipping/Model/Checkout/Type/Multishipping.php

texts:
so far I've experienced some complications performing this override, I had to override also PlaceOrderDefaulr, PlaceOrderFactory and PlaceOrderInferface
I've added preferences tags in ../etc/di.xml of my module to include above mentioned classes, but now the error prompted is:

Fatal error: Uncaught TypeError: Argument 1 passed to
Magento\Multishipping\Model\Checkout\Type\Multishipping::__construct()
must be an instance of Magento\Checkout\Model\Session, array given,
called in
C:\xampp\htdocs\Magento2.2.5\app\code\Inchoo\Hello\Model\Checkout\Type\Multishipping.php
on line 271 and defined in
C:\xampp\htdocs\Magento2.2.5\vendor\magento\module-multishipping\Model\Checkout\Type\Multishipping.php:209
Stack trace: #0
C:\xampp\htdocs\Magento2.2.5\app\code\Inchoo\Hello\Model\Checkout\Type\Multishipping.php(271):
Magento\Multishipping\Model\Checkout\Type\Multishipping->__construct(Array)
1 C:\xampp\htdocs\Magento2.2.5\vendor\magento\framework\ObjectManager\Factory\AbstractFactory.php(111):
Inchoo\Hello\Model\Checkout\Type\Multishipping->__construct(Object(Magento\Checkout\Model\Session),
Object(Magento\Customer\Model\Session),
Object(Magento\Sales\Model\OrderFactory),
Object(Magento\Customer\Model\ResourceModel\AddressRepository),
Object(Magento\Framework\Event\Manager\Proxy),
Object(Magento\Framework\A in
C:\xampp\htdocs\Magento2.2.5\vendor\magento\module-multishipping\Model\Checkout\Type\Multishipping.php
on line 209


texts: I am using this extension to display New Products in Home Page. I disabled the extension from Admin Panel but it is still displaying New Products in Home Page. Cache is disabled in my site. Why it is doing so ??


texts: Fatal error: Class Helper_Data not found in app\Mage.php

texts:
Fatal error: Class 'Mage_Category_Password_Helper_Data' not found in /home/pypub/public_html/app/Mage.php on line 547

I've read this: Fatal error: Class Helper_Data' not found in app\Mage.php but can't seem to fix it

config:

<global>
        <helpers>
            <CategoryPassword>
                <class>SUN_CategoryPassword_Helper</class>
            </CategoryPassword>
        </helpers>

SUN/CategoryPassword/Helper/Data.php

<?php

class SUN_CategoryPassword_Helper_Data extends Mage_Core_Helper_Abstract {

}

Is it something to do with Category_Password vs CategoryPassword?


texts: Product reviews not showing in tab in magento 2.3.5

texts:
This thread is similar to this
I have a problem with displaying product reviews in tab , i can insert a review but the reviews are not showing (in tab title i see the number of the reviews) , the #product-review-container div is empty


texts: Is there a way to completely destroy a modal in Magento 2

texts:
I have created a modal with some dynamic content (input fields) and a save button to save input field data in database and I'm opening that modal on a button click.

Now when I fill all the input fields and save it or when I close the modal by pressing the "X" icon at top right without saving, the data in the modal persists and doesn't get cleared when I reopen that modal using button click.

Is there a way to completely destroy that modal and create a fresh one on each button click?


texts: Magento database optimization slow query

texts:
my website was getting internal 500 error intermediately, my hosting provider(siteground) told me that the magento database was running slow queries ( 80 in the past 24 hours), which cause spikes on on the ram usage (I have 8G RAM). I have safely clear the log tables to optimize the database. What should I do to identify and optimize the 'slow query' from magento2? below is one query that they provided to me as an example.
Executed 36m 19s ago for 23.325775 sec on Database --> magento2_db

Date: 2021-01-04 23:06:46 Query_time: 23.325775 Rows_examined: 357: Rows_sent 28 Lock_time: 1.068401 Query_chars: 446
SELECT ROUND(`price_index`.`min_price`, 2) AS `value` FROM `temp_044fcb9aee8455bb52bd25c3c818e93c54bf60cd` AS `e` INNER JOIN `catalog_product_index_price` AS `price_index` ON `price_index`.`entity_id` = `e`.`entity_id` AND `price_index`.`website_id` = '1' AND `price_index`.`customer_group_id` = 0 WHERE (ROUND(`price_index`.`min_price`, 2) >= 49.995) AND (ROUND(`price_index`.`min_price`, 2) < 1899.995) ORDER BY `value` ASC LIMIT 28 OFFSET 17;

AND
=== Databases Info =====================================================================================
  Database          Label                 Tables Views InnoDB MyISAM Slow Queries Slowest Query DB Size
  ----------------- --------------------- ------ ----- ------ ------ ------------ ------------- --------
  magento2_db    live_site        446     0    432      0           78


texts:
I have a store running 1.7.0.2 (updated from a clean install of 1.6). The store keeps running into the "An error occurred while saving the URL rewrite" error.

The store is a very simple installation with only premium matrix rate installed as an additional module.

Error:

  On trying to refresh the Catalog URL Rewrites the following error occurs:
  "An error occurred while saving the URL rewrite"

Attempts to fix:

recursively chown entire store directory to correct user
recursively chmod 777 var and media
clear var/session, var/cache, var/locks
Backup and truncate core_url_rewrite (resolves or a short time) but less than ideal due to indexing issues on renamed products and future use of custom rewrites

Logs:
Checking the logs the errors that are being generated are along the following lines:

  SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'category-name/sub-category-1' for key 'UNQ_CORE_URL_REWRITE_REQUEST_PATH_STORE_ID'

Database:
UNQ_CORE_URL_REWRITE_REQUEST_PATH_STORE_ID belongs to core_url_rewrite and is a UNIQUE KEY across the store_id and request_path.

The duplicate value in question doesn't actually exist in the request_path however multiple instances of request_path/store_id duplicates seem to be in the database.

Example of a duplicate entry:

INSERT INTO `core_url_rewrite` (`url_rewrite_id`, `store_id`, `category_id`, `product_id`, `id_path`, `request_path`, `target_path`, `is_system`, `options`, `description`)
VALUES
    (5246, 1, 376, NULL, 'category/376', 'test-assemblies/123-assemblies', 'catalog/category/view/id/376', 1, NULL, NULL),
    (6334, 1, 376, NULL, 'category/376', 'test-assemblies/123-assemblies', 'catalog/category/view/id/376', 1, NULL, NULL);

Questions

Would it be safe for me to go through and remove all duplicate entries and potentially resolve the issue?
What could be happening to allow duplicate entries to occur?
Can anyone shed any light on the issue?

Update: seems to be an issue with categories not product looking further into the issue.


texts: magento 2 category delete function programmatically

texts:
I would like to delete categories and sub categories pro-grammatically in magneto 2.

  Please suggest me proper code for it.


texts: Just want to know simple question in magento

texts:
If 5000 people log in to the Magento admin panel (domainname.com/admin) at the same time or in the gap of 5 minutes then what will happen?

The interviewer asked me such type of question. If anyone has an answer then please comment on this.


texts:
In catalog/product/view.phtml I have:

<?php echo $this->getReviewsSummaryHtml($_product, "short", true)?>

Which shows the summary_short.phtml version of the reviews, however, when I then click to go to the reviews the catalog/product/view.phtml is still used, so the same parameters will be used for the reviews summary, however it shows the rating/detailed.phtml version.

Any ideas why this is?


texts: Magento 2 : Display Related Products Block in Product View

texts:
I'm using magento 2.1.3 and I want to display related products under product_view. Product view is using 1 column template.

I've added successfully related products to some products. I've reindexed after adding related to products. I've cleaned cache after each change of code.

In

  /vendor/magento/module-catalog/view/frontend/layout/catalog_product_view.xml

The related products block is placed in referenceContainer name="content.aside" which is not present in my product view as it is one column.

I've overridden this layout in

  /app/design/frontend/myCompany/myTheme/Magento_Catalog/layout/catalog_product_view.xml

and every change is working except related products block.

I tried to move it like this

<move element="catalog.product.related" destination="content" after="product.info.main" />

I used several different destinations, even without using after/before, but related products block is not appearing anywhere.

I tried also to call it

<block class="Magento\Catalog\Block\Product\ProductList\Related" name="catalog.product.related" type="related" template="Magento_Catalog::product/list/items.phtml">
    <arguments>
        <argument name="type" xsi:type="string">related</argument>
    </arguments>
</block>

I tried even using and not using type="related" in this last way of calling, but even with or without the 'type' the block is not appearing.

Does somebody have any idea?


texts:
We have been experiencing something strange and unusual the past couple of months. We get about 30 orders a day, and for the past 2 months, we have 5 known cases where customers place an order, but the order is not created in Magento. They are charged, and there is a transaction in Authorize.NET. There is a quote in Magento DB, but no order or invoice records. Authorize.Net holds what the order's "Increment ID" should be, but when you try to look it up in the backend Sales -> Orders, it is not there.

Searching on Google, I see cases of this happening when the orders are placed through eBay or some other interface, but in these cases the customers are placing orders directly the our site.

The only thing I've found that these orders have in common is they are placed roughly around the same time (authorize.net submit date), between 18:00-20:00. We do have crons for data imports and db backups, but those run around 22:00-1:00..  What could possibly be causing this? I'm hoping this isn't too local of a question, and sorry if it is.


texts: Warning: “The method parameter $context is never used”

texts:
I am getting issue "The method parameter $context is never used" in my InstallData.php script when submitting Magento2 extension to marketplace in technical review.

Can Anyone help me to solve this issue ?


texts:
this code return shipping method title ...
how i can get shipping description ?

define(
[
    'jquery',
    'Magento_Checkout/js/view/summary/abstract-total',
    'Magento_Checkout/js/model/quote'
],
function ($, Component, quote) {
    return Component.extend({
        defaults: {
            template: 'Magento_Checkout/summary/shipping'
        },
        quoteIsVirtual: quote.isVirtual(),
        totals: quote.getTotals(),
        getShippingMethodTitle: function() {

            if (!this.isCalculated()) {

                return '';
            }
            var shippingMethod = quote.shippingMethod();
            return shippingMethod ? shippingMethod.carrier_title + " - " + shippingMethod.method_title : '';
        },
        isCalculated: function() {
            return this.totals() && this.isFullMode() && null != quote.shippingMethod();
        },
        getValue: function() {
            if (!this.isCalculated()) {
                return this.notCalculatedMessage;
            }
            var price =  this.totals().shipping_amount;
            return this.getFormattedPrice(price);
        }
    });
});


texts: I got a piece of code as seen in the image below in a Smarty template outputting the payment method. Please help me a find a way to set color "red" only to the value of "{$search_results_list[searchresults].cc_type}". Thank you.


texts:
I'm using checkout_cart_product_add_afterobserver.

In observer

public function execute(\Magento\Framework\Event\Observer $observer)
{
    $item = $observer->getEvent()->getQuoteItem();
    $item->setCustomPrice($price);
    $item->setOriginalCustomPrice($price);
    $item->getProduct()->setIsSuperMode(true);
    $item->save();

}

Above code is working properly for the first time.

I'm clearing cart everytime before any items are added to cart.

So that code is working properly in first time but if I add products to cart second time I'm getting subtotal of product 0.

I'm add multiple items into cart and it's working fine but I want to set custom price for each product that's why using above code...


texts: Magento 2 caches keep disabling themselves

texts:
During deployments we sometimes have the problem, that all the caches disable themselves, for no apparent reason.

During deployment, we basically execute the following commands:

bin/magento maintenance:enable
bin/magento setup:upgrade
bin/magento setup:static-content:deploy de_DE en_US en_GB --theme vendor/theme
bin/magento setup:static-content:deploy de_DE en_US en_GB --area adminhtml
bin/magento setup:di:compile
bin/magento maintenance:disable

There are some other commands in between, but not related to Magento directly (i.e. no bin/console command, e.g. Varnish & Redis cache flushing).

This is extremely irritating since this will basically crash the server, when the maintenance mode is disabled for the live site and no cache whatsoever is active!

How can this happen? Why does Magento touch the cache setting by itself at all? What could be responsible for that?

Magento Version: 2.2.8
PHP Version: 7.1


texts: How to get the checkout page register Entered value in core file

texts: I need the value enter the checkout page customer register form entering value in app/code/core/Mage/Tax/Model/Calculation.php file. IS possible to get the entering value .


texts: Certain option not showing in layered navigation in Magento 2.2.6?

texts:
I am running a Magento 2.2.6 store. I have an attribute called max-size. Now when I navigate to a category page, it does not show all possible options represented by the products shown in the category.

One product, for example, has 200 as max-size but that's not shown in the filter. Other values are shown, so the attribute can be filtered, it just misses some of the filter options.

I rebuild the index using bin/magento indexer:reindex and also cleaned the cache, did not help.

Any ideas?


texts:
I added my code to my custom header phtml:
<?php
                              $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
                              $catId = 2;
                              $subCategory = $objectManager->create('Magento\Catalog\Model\Category')->load($catId);
                              $subCats = $subCategory->getChildrenCategories();
                              $_helper = $this->helper('Magento\Catalog\Helper\Output');
                              $hasSubcategories = count($subCats) > 0;
                           ?>

                           <?php

                           foreach ($subCats as $subcat) {
                              $_category = $objectManager->create('Magento\Catalog\Model\Category')->load($subcat->getId());
                              $subcaturl = $subcat->getUrl();
                              ?>

                                       <a class="level1 has-children" href="<?php echo $subcaturl . '?cat=' . $_category->getId() ?>"><?php echo $subcat->getName(); ?> (<?php echo $product_count = $_category->getProductCount();?>)
                                       <?php
                                          $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
                                          $object_managertwo = $objectManager->create('Magento\Catalog\Model\Category')->load($subcat->getId());
                                          $subcatslevelthird = $object_managertwo->getChildrenCategories();
                                       ?>
                                          <?php if ($subcatslevelthird->count() > 0) { ?>

                                                <?php
                                                   foreach ($subcatslevelthird as $subcatthird) {
                                                      $_outputhelper = $this->helper('Magento\Catalog\Helper\Output');
                                                      $subcaturl = $subcatthird->getUrl();
                                                ?>

                                                      <a class="level2" href="<?php echo $subcaturl ?>"><?php echo $subcatthird->getName(); ?> (<?php echo $subcatthird = $_category->getProductCount();?>)

                                                <?php } ?>

                                    <?php } ?>

                        <?php } ?>

all working properly except adding class to li element, i need display class parent - only for if menu has submenu, whats wrong?


texts:
In Magento 2.1.6, I edited the product data, such as price, name, description. But in the frontend it does not updateon the product listing grid , I already cleaned and flushed the cache, I do not know what can I do

When I export products , in .csv attribute store_view_code value is empty, or default. I have only 1 store view

What I can do? Thanks in advance.


texts: Magento 2 Getting Error "infinite loop detected review the trace for the looping path" on checkout page

texts:
I have override the tax calculation module class "Magento\Tax\Model\Calculation" and pass the class in "\Magento\Checkout\Model\Cart" in constructor function as a dependency injection.
My requirement was to change the tax calculation when end user change to shipping method.therefor I used the class \Magento\Checkout\Model\Cart to get the shipping method name.
It was working and getting the shipping method when end user change from frontend and on the basis of shipping method name changing the logic to fulfill the requirement.
Now when click on button Place Order to make the order I am getting below error.
"infinite loop detected review the trace for the looping path" .
Can anybody have idea why this error occurring and what's the other way to get the shipping method in tax calculation class.
I have tried many methods but not getting any work.Please help.
Below is the reference what I did.
https://magento.stackexchange.com/a/320793/24878
Thanks


texts: New created attributes not found, after use EavSetup to create

texts:
I use \Magento\Eav\Setup\EavSetup to create a new attribute. Note that this is not implemented on Install or Upgrade as the function is for import the latest data from other sources.

The problem is after successfully created a attribute, assigned to the group and set. When fetching the product attributes, the new attribute is not found. Even after clearing cached, and cause the process crashes

But when access the Magento Admin, the attributes created and shown correctly, that makes the next import successful.

Create attribute

$setup = $this->objectManager->create('\Magento\Eav\Setup\EavSetup');
$attributeValue = array(
        'group'                   => $group,
        'type'                    => 'varchar',
        'backend'                 => '',
        'frontend'                => '',
        'label'                   => $label,
        'input'                   => 'text',
        'class'                   => '',
        'source'                  => '',
        'global'                  => \Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface::SCOPE_GLOBAL,
        'visible'                 => true,
        'required'                => false,
        'user_defined'            => true,
        'default'                 => '',
        'searchable'              => false,
        'filterable'              => false,
        'comparable'              => false,
        'visible_on_front'        => false,
        'html_allowed_on_front'   => true,
        'used_in_product_listing' => false,
        'unique'                  => false,
        'apply_to'                => ''
    );

$setup->addAttribute(
        \Magento\Catalog\Model\Product::ENTITY,
        $attributeCode,
        $attributeValue
);

Assign to group and set:

// Add group
$setup->addAttributeGroup(
        \Magento\Catalog\Model\Product::ENTITY,
        $attrSetId,
        $group,
        $attributeCode,
        null
);
// Add attribute to set
$setup->addAttributeToSet(
        \Magento\Catalog\Model\Product::ENTITY,
        $attrSetId,
        $group,
        $attributeCode,
        null
);

Clear cached

$cache = $this->objectManager->create('\Magento\Framework\App\Cache\TypeListInterface');
$types = array('config','collections','reflection','db_ddl','eav','config_integration','full_page');
foreach ($types as $type) {
    $cache->cleanType($type);
}
return;

I think the new attribute has not updated in the current run time environment or cached, I tried to clear the cache, but still not working.


texts:
I have bought a template from themeforest and I've noticed the entries in hot-sale tab stop showing a day before the special_to_date attribute is set ( meanwhile the general product listing is correct , and shows products on sale including the last day of campaign ).

So if we set a campain from 25th to 27th august, the hot-sale tab is empty ( today ) but the products are still on sale on general listings ( as they should ).

So I've looked into the template code and found this:

$todayDate  = Mage::app()->getLocale()->date()->toString(Varien_Date::DATETIME_INTERNAL_FORMAT);
$collection = Mage::getResourceModel('catalog/product_collection')
    ->addAttributeToSelect(Mage::getSingleton('catalog/config')->getProductAttributes())
    ->addAttributeToFilter('special_from_date', array('or'=> array(
        0 => array('date' => true, 'to' => $todayDate),
        1 => array('is' => new Zend_Db_Expr('null')))
    ), 'left')
    ->addAttributeToFilter('special_to_date', array('or'=> array(
        0 => array('date' => true, 'from' => $todayDate),
        1 => array('is' => new Zend_Db_Expr('null')))
    ), 'left')
    ->addAttributeToFilter(
        array(
            array('attribute' => 'special_from_date', 'is'=>new Zend_Db_Expr('not null')),
            array('attribute' => 'special_to_date', 'is'=>new Zend_Db_Expr('not null'))
            )
      )
    ->addAttributeToSort('price', 'asc')
    ->addTaxPercents()
    ->addStoreFilter();

Now, I'm not that good of a programmer with Magento.. and I don't really understand these addAttributeToFilter but my best bet is that this is exclusive ( regarding the campaign ending date ):

->addAttributeToFilter('special_to_date', array('or'=> array(
    0 => array('date' => true, 'from' => $todayDate),
    1 => array('is' => new Zend_Db_Expr('null')))
), 'left')

So, if you can shed some light on this, please do. I only guess with my little knowledge this would be the problem which doesn't collect produdcts in their last day of special_to_date.


texts:
what is wrong with this foreach, it came with the theme but always comes up with error invalid argument, I don't do code so don't know if its a missing bit of code or missing table or what, its in the theme Helper/Data.php

public function getType(Mage_Catalog_Model_Product $product)
{
    if ('Mage_Catalog_Model_Product' != get_class($product) )
        return;
    foreach ($product->getOptionsType as $o) {
        $optionType = $o['type'];
        if ($optionType == 'file') {
            return true;
        }
    }
    return false;
}


texts: Magento 2 replace fotorama with custom plugin with js on product page

texts:
Hi I have created jquery custom zoom gallery plugin. And want to replace default fotorama with mine on product page. For this purpose I want to use magento 2 plugin. Which I already started and created. It is just HelloWorld plugin yet for now.

Is it possible somehow to do this without touching core files or theme files. But only via magento 2 plugin system?

Thanks.


texts: How to create a blank page without any header,footer blocks?

texts:
Am creating a cms page for sellers, like www.mysite.com/seller with unique nav-bar,footer,header,logo etc..but it all shows under my default theme's header,footer blocks.I planned to show those cms as like new website without any blocks from my store.

How to show a cms page header,footer,navbar as like a new domain?

or

Is it only possible by creating sub-domain for my site like
seller.mysite.com?


texts: Authorize.net form not display in magento2 custom page

texts:
I am trying to display custom Authorize.net and for that I have override Magento\Payment\Block\Form\Container. I got the Authorize payment method radio but not able to get form to dispaly.

can any one help?

to get above payment method I have override Magento\Payment\Block\Form\Container and layout as given below:

<block class="Namespace\Modulename\Block\Customer\Payment\Method\Form" template="customer/payment/method/form.phtml" name="payment_methods">

my form.phtml code is:

<?php <?php if ($block->hasMethods()): ?>

    <?php
        $_methods       = $block->getMethods();
        $_methodsCount  = count($_methods);
        $_counter = 0;
    ?>
    <?php foreach ($_methods as $_method): $_code = $_method->getCode(); $_counter++; ?>

        <?php if ($_methodsCount > 1): ?>
            <input id="p_method_<?php /* @escapeNotVerified */ echo $_code ?>" value="<?php /* @escapeNotVerified */ echo $_code ?>" type="radio" name="payment[method]"
                   title="<?php echo $block->escapeHtml($_method->getTitle()) ?>"
                   onclick="payment.switchMethod('<?php /* @escapeNotVerified */ echo $_code ?>')"<?php if ($block->getSelectedMethodCode() == $_code): ?> checked="checked"<?php endif; ?>
                   class="admin__control-radio<?php if ($_counter == $_methodsCount) : ?> validate-one-required-by-name<?php endif; ?>"/>
        <?php else :?>

                <input id="p_method_<?php /* @escapeNotVerified */ echo $_code ?>" value="<?php /* @escapeNotVerified */ echo $_code ?>" type="radio"
                       name="payment[method]" class="admin__control-radio" checked="checked"/>

        <?php endif;?>

            <label class="admin__field-label" for="p_method_<?php /* @escapeNotVerified */ echo $_code ?>"><?php echo $block->escapeHtml($_method->getTitle()) ?>

    <?php endforeach; ?>

            <button class="action tocart primary" title="Pay Installment" type="submit">
                <?php echo __("Pay"); ?>
            </button>

All ok and all payment method display properly but authorized.net form not apears on click of 'authorized.net'.

Can Anyone Help me?


texts: Magento2 :: Why cron:run, update/cron.php, setup:cron:run needed

texts:
In Magento Devdocs for setting up cron it is recommended to schedule 3 seperate scripts

* * * * * <path to php binary> <magento install dir>/bin/magento cron:run | grep -v "Ran jobs by schedule" >> <magento install dir>/var/log/magento.cron.log
* * * * * <path to php binary> <magento install dir>/update/cron.php >> <magento install dir>/var/log/update.cron.log
* * * * * <path to php binary> <magento install dir>/bin/magento setup:cron:run >> <magento install dir>/var/log/setup.cron.log

I am trying to understand what is the role of each of these scripts scheduled.

I am sorry if this a duplicate question or a stupid question, but i could not find anything relating to this


texts: Check if product with sku exists in Magento 2

texts:
In Magento 1.x I could do

if(Mage::getModel('catalog/product')->getIdBySku($sku))

How can I check this in Magento 2?


texts:
I think the biggest table I am looking to clear is core_session, it is 500mb. Not sure about the logging event

This should be ok to truncate?


texts:
On my account -> my order, there is order detail page and there are price, qty, subtotal column

I wand to add other attribute data like 'brand' attribute

I found on items.phtml

            <?php echo $this->__('Product Name') ?>

            <?php echo $this->__('Price') ?>
            <?php echo $this->__('Qty') ?>
            <?php echo $this->__('Subtotal') ?>

I can add th style on the file but I have no idea how to load the attribute data


texts: How to create more than one option on the same shipping method?

texts:
I need insert more than one radio on the same shipping method but I dont know to do this. Someone person to help me?

<?xml version="1.0"?>
<config>
  <modules>
    <Envato_Customshippingmethod>
      <version>1.0</version>
    </Envato_Customshippingmethod>
  </modules>
  <global>
    <models>
      <envato_customshippingmethod>
        <class>Envato_Customshippingmethod_Model</class>
      </envato_customshippingmethod>
    </models>
    <helpers>
      <envato_customshippingmethod>
        <class>Envato_Customshippingmethod_Helper</class>
      </envato_customshippingmethod>
    </helpers>
  </global>
  <default>
    <carriers>
      <envato_customshippingmethod>
        <active>1</active>
        <sallowspecific>1</sallowspecific>
        <model>envato_customshippingmethod/demo</model>
        <name>SM Retirada na Loja</name>
        <price>0.00</price>
        <title>Método de Entrega por Retirada na Loja</title>
      </envato_customshippingmethod>
    </carriers>
  </default>
</config>


texts: Images on listing page not as clear as in description page

texts:
The images on the listing page are not clear but in the product description page are clear. What can be done to improve clarity?

The listing page images are smaller in size to the description page. we uploaded images with water mark in 1100*1100 specification.


texts:
We have found the issue in default magento2.1.7, Flat price is not showing up in while placing the order.

Please find the screenshots:

Admin:

Frontend:

Thanks


texts:
I'm new to Magento

I get this template that I don't want to split into multiple blocks. I just want to render the page as it is (not only, but this is something I can try to understand later) when I go to some url.

So for example, going to /route/controller/action should display an html page I wrote from  to  (including, of course, HEAD and BODY).

So I read a few things. I followed some official tutorials and could create a module and an Action to render a JSON. Works fine! Going to /test/page/view shows a dumb json. Now I want to do something similar to render a page (and eventually pass parameters to it)

(http://devdocs.magento.com/videos/fundamentals/create-a-new-module/)

So this is what I get right now:

/Vendor/Module/etc/frontend/routes.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
    <router id="standard">
        <route id="victor" frontName="test">
            <module name="Victor_Template" />
        </route>
    </router>
</config>

/Vendor/Module/Controller/Page/View.php

namespace Victor\Template\Controller\Page;

use \Magento\Backend\App\Action\Context;
use \Magento\Framework\App\Action\Action;
use \Magento\Framework\Controller\Result\JsonFactory;
use \Magento\Framework\View\Result\PageFactory;

class View extends Action
{
    protected $resultPageFactory;

    function __construct(Context $context, PageFactory $resultPageFactory){
        $this->resultPageFactory = $resultPageFactory;
        parent::__construct($context);
    }

    public function execute(){
         return $this->resultPageFactory->create();
    }
}

.../view/frontend/layout/template_page_view.xml (maybe the error is here)

<?xml version="1.0" ?>
<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">

        <referenceContainer name="content">
            <block class="Victor\Template\Block\Page\View" name="page.view" template="Victor_Template::page/view.phtml"/>
        </referenceContainer>

</page>

.../view/frontend/templates/page/view.phtml

Hello World!

After cleaning cache, flushing cache, giving permissions and upgrading setup (something I have to do all the time some change occurs in the code), I get an HTTP code 200 that gives me back a blank (totally white) Magento page that contains references to css, javascript files and a weird  like this:

Anyway, I don't know what is happening in background. Something tells me the error is the definition of the layout (template_page_view)

I wanted the response to be just
Hello World!
.

What am I doing wrong and what is the proper way of doing it on Magento??

@edit

I added this to my View:

$resultPage = $this->resultPageFactory->create();
$resultPage->addHandle('template_page_view'); //loads the layout of module_custom_customlayout.xml file with its name
return $resultPage;

And now I get this error:

  Object DOMDocument should be created.#0 /.../magento/vendor/magento/framework/View/Element/UiComponent/Config/Reader.php(95): Magento\Framework\View\Element\UiComponent\Config\DomMerger->getDom()

Is it a permission issue? Did I setup my layout incorrectly?
Regarding the layout, I took it from a tutorial I saw in a random website, what does the class property refering to /Block mean?


texts: Cache blocks that contain form_key (i.e. dynamic content)

texts:
I wonder, if there is a best practice to use block caching for blocks that contain a form with the form_key input (CSRF token).

I am not talking about full page cache hole punching, but the standard block cache of Magento CE.

Generally spoken: How would you cache a block with a small portion of dynamic content, or a child block that is not cached?


texts: Magento 2.3: Checkout page displays only `loading image` after checkout_index_index.xml was overridden in the custom theme

texts: The checkout page now display loading image forever after I have overridden the  checkout_index_index.xml in the custom theme to remove faxfield from the checkout page. Below is the screenshot showing the customized xml. Could you please point out the issue that might be causing endless loading image. Thank you.


texts: New Checkout Billing Address Form Field not saving value to the database

texts:
I have added a new checkout billing address form field for entry of an optional field for the customer.

Have overridden the template checkout form and able to get the field onto the form, but cannot do anything with the data that is inputted into it, when a user enters data nothing is done with it.

Custom Field is the field that is added, I need what is entered into the text field to be saved into the Customers Billing address

And then it should appear along with the rest of the billing information


texts: Does magento 1.9.0.1 have the old Google analytics or the new universal analytics?


texts: i want to upgrade only PayPal module in magento is it possible to upgrade only PayPal module?


texts:
I changed in the table "eav_entity_text" my order "increment prefix" into "ON-" and in "increment_last_id" i set it to "ON-10001".
Also i changed in table "eav_entity_type" the "increment_pad_length" of orders to "5".
But when i now make a order everytime my store adds a "1" to the order increment ID.

For example:
 - First order: 10002
 - Second order: 110003
 - Third order: 1110004
and so on...

I dont know whats going wrong? It wont use my prefix for orders, for invoices it works well...


texts: Layered navigation on homepage in magento 1.9 Call to a member function load() on a non-object in Error Occured

texts:
I am trying to show a layered navigation on homepage. I m using magento 1.9.0. and inserted following xml in Layout Update XML

<reference name="left">
    <block type="catalog/layer_view" name="catalog.leftnav" after="currency" template="catalog/layer/view.phtml"/>
</reference>

Then in app\code\core\Mage\Catalog\Model\layer.php modified function getCurrentCategory() as follows to get root category on home-page:

public function getCurrentCategory()
{
    $category = $this->getData(’current_category’);
    if (is_null($category)) {
        if ($category = Mage::registry(’current_category’)) {
            $this->setData(’current_category’, $category);
        }
        else {
            $category = false;
            $this->setData(’current_category’, $category);
        }
    }

    // added to make this work for front page:
    if(is_null($category) || $category == false) {
        $home_category = Mage::getModel(’catalog/category’)->load(4); //number must correspond to ‘all products page’ category
        $this->setData(’current_category’, $home_category);
        $category = $this->getData(’current_category’);

        return $category;

    }

    //end addition

    return $category;
}

But Following error has occurred:

  Fatal error: Call to a member function load() on a non-object in app\code\core\Mage\Catalog\Model\Layer.php on line 174

Please help.


texts: What is wrong with this layout? Unable to call block from non-local.xml file

texts:
Inside my local.xml file I have this

<default>
    <label>All Pages</label>
    <block type="page/html" name="root" output="toHtml">
        ...
        <block type="core/template" name="sidebarblock" as="sidebarblock" template="abcpage/html/sidebarblock.phtml">
            <block type="core/template" name="featuredrange" as="featuredrange" template="abcpage/html/recommendedrange.phtml"></block>
           <!--marker for later-->
       </block>
       ....
   </block>

I can successfully add my "target" block by replacing  "marker for later"
with the block call:

<block type="abc_articles/catalog_category_list_article" name="category.info.articles" as="category_articles" template="abc_articles/catalog/product/list/article.phtml"></block>

and it all shows up using $this->getChildHtml("category_articles") in the sidebarblock.phtml

However, I just want to add this on "catalog_category_view" .  I have a separate article-related layout xml file which is being picked up for other things but when I use this instead (clearing out the marker bit above):

    <catalog_category_view>
        <reference name="sidebarblock">
            <block type="abc_articles/catalog_category_list_article" name="category.info.articles" as="category_articles" template="abc_articles/catalog/product/list/article.phtml"></block>
        </reference>
    </catalog_catagory_view>

zip....nada...nothing...nowt and no block content.

Suggestions to fix please...guess I am just missing something fundamental here but cannot spot what (maybe because it is nearly 5pm).  Thanks


texts: How To override the ui-component ViewAction.php in module-sales/Ui/Component/Listing/Column

texts:
I want to add another action in the grid for the sales in Magento back end

The actions are defined in modules-sales\Ui\Component\Listing\Column\ViewAction.php

So i want to override this file , But how can i override ?


texts: How to make field as WYSIWYG editor in system.xml in configuration?

texts:
I want to display editor not only textarea so please let me know what can I do here, and how to remove Insert Widget / Insert Variable / Insert Image button there?

<field id="gird_view" translate="label" type="textarea" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
   <label>Grid View Design</label>
</field>


texts: Deleting website in Magento gives page not found error

texts: I have multiple websites in a store. I want to delete two of them. Including the main website and its stores and store views. After I delete them when i try to access my site from the websites that are not deleted it displays page not found error. What could be the cause for it and how can I solve it?


texts: Why admin menu and some styles working after modifying class Symlink -> Copy?

texts:
I have installed Magento ver. 2.1.2, Admin menu is not working and some of the front end styles are not coming properly.

After I replace (app/etc/di.xml) as in the below code, everything is working fine. I have been facing this issue with all Magento 2 versions.

Magento\Framework\App\View\Asset\MaterializationStrategy\Symlink

To

Magento\Framework\App\View\Asset\MaterializationStrategy\Copy

I got followed Solution for Inactive Admin Links in Magento 2 (Windows)

Can anybody tell me

Why the class replacement is necessary ?
Is this an internal bug ?
Am I missing something ?


texts: Move Search Box to left of logo in header

texts:
In Magento2.4 I want to move the search bar to the left of the logo then have the logo center and then have the shopping cart stay where it is on the right side of the header.
I edited the code at

app/design/frontend/Mycompany/luma_child/Magento_Theme/layout/default.xml

I added

However that did not work even though I redeployed and cleared cache
Any suggestions on how I can get the search box on the left, logo in the middle and the shopping cart icon on the right?
Thank you


texts:
The order grid has to be filtered by default based on the user roles
I have different roles of users .
pakaging team .
invoice team .
For a user belong to packing team the grid should be filtered by default to orders in filtering state.


texts: Bundle Product Price Not Updating On Product Page When Selecting Options

texts:
I have created a bundle product with 2 options.

One option is a dropdown menu (required).

The 2nd option is a checkbox (required).

When I select my options the price in the right column is not updated.

Once added to cart the price reflected is correct.

Magento version is 2.2.3

Any ideas?


texts: Check if signed In user has ordered something in magento 2

texts: how do I check the user order status is completed in a custom module?


texts: SQL Error When Making New Products on Magento "Column 'price_type' cannot be null"

texts:
This is the error I am getting. This error message shows whether I am duplicating a product or if I am making a new one. I'm unsure of what is causing this, but the log clearly shows it trying to write a "NULL" column.

This is for a client of mine who hasn't tried to add a new product since he's been with me (only 3 months, so not long). So I am unsure of what backup we would need to restore, and I've put in a ton of work that I'd like to not have to re-implement.

Any input would be greatly appreciated!


texts: Magento 2.3.3 - show search bar on mobile version

texts:
The search bar appears in the mobile version when you press the magnifying glass. I wish the search bar could move under the logo and be active all the time.
Can anyone guide me?

I use Magento 2.3.3 with Codazon Infinit theme.

What is currently there (you need to click the search icon to make the search bar appear)


texts: Magento 2 Extension display subcategories in block

texts:
I need to create new module, which allows to display subcategories for a specified category inside block.

I call the block like this:

<block
  class="Vendor/Module/Block/CategoryList.php"
  category_id="7"
  template=Vendor_Module::CategoryList
/>

Found a lot of solutions here, but couldn't make anyone work for me, I am using magento 2.2.

EDIT:
I don't know how correct this is, but I managed to get the result I wanted doing this:

categories.phtml

<?php
$categoryId = $this->getCategoryId();
$categories = $block->getStoreCategories();
$c = 0;

foreach($categories as $category) :
    $c++;

    if($c > 1) {
        break;
    } ?>

            <?php
            $category = $block->getCategory($categoryId);
            echo '
getUrl().'" title="Parent Category">'.$category->getName().'
';
            if($category->hasChildren()) {
                $subCategories = $category->getChildrenCategories();

                foreach($subCategories as $subCategory) {
                    $subCategoryObj = $block->getCategoryById($subCategory->getId());
                    echo '
getUrl().'" title="Subcategory">'.$subCategory->getName().'
';
                }
            } ?>

<?php endforeach;?>

and then I call the template in the block like this:

default.xml

<block class="Vendor\CategoryList\Block\Categories" name="category.list" template="Vendor_CategoryList::categories.phtml">
    <action method="setCategoryId">
        <argument name="category_id" xsi:type="string">42</argument>
    </action>
</block>


texts: magento 2 How to get dropdown selected value in knockout js on button click

texts:
I have my custom payment method on the checkout page with the dropdown list.
and I want to get that dropdown selected value in knockout js and forward it to controller and store dropdown value in my custom table.

/view/frontend/web/template/payment/custom.html

                    <select id="credit_days"
                            class="credit_days"
                           name="credit_days"
                           data-validate="{required:true}"
            onChange="if(this.value=='requestmore'){document.getElementById('request_more').style.display='block';}else{document.getElementById('request_more').style.display='none';}"
                           data-bind="value:creditDaysSelected(), optionsCaption:'Please chose days...'"
                           >
                        <option value="10days">10 Days</option>
                        <option value="20days">20 Days</option>
                        <option value="30days">30 Days</option>
                        <option value="40days">40 Days</option>
                        <option value="requestmore">Request More Days</option>
                    </select>

                        <input type="text" data-validate="{required:true}" name="request_more_credit_days" id="request_more_credit_days" placeholder="Enter credit Days of your choice" required>
                        <button type="submit" class="button primary action">  </button>

I want to store dropdown selected value to my custom DB table on click of button using a controller.

Any help will be appreciated.
Thanks in advance


texts: Magento2 need to remove checked="true" from shipping methods radio button even when 1 shipping method is available

texts:
I need to remove checked="true" from shipping methods radio button even when 1 shipping method is available
How can I achieve this as magento2 by default adds check true when single shipping method


texts:
I'm sure that Title sounds cryptic . ..

As you probably know, in order to get Magento to integrate with Fedex so that it will print shipping labels, you have to setup a test account with Fedex, jump through some hoops, and then they approve you for it.

Well, I got a test account number and set it up in Magento, but it's not working.  I finally checked the logs and .... low and behold the Account ID that it is sending to Fedex is my REAL account number (even though it is using all the other test credentials. . .meter number password etc).

In short . . . Magento is accepting all the account changes EXCEPT the actual account number.   Fedex has confirmed they are seeing the info via my REAL account info trying to get to the Fedex server.

This must be some sort of Magento glitch, does anyone have a workaround on this?


texts: magento 2 : How to add static block in (.html) file?

texts:
I want to add static block over the Place order  button! So I have used Firecheckout extension and I found place order button here view/frontend/web/template/place-order.html on my extension.

So how can add a static block in this file?

If another way to add static block then also let me know.


texts:
With a custom module, I have made some widgets that I added to my Magento 2 installation. I am using this module in several other projects.

I have added an option to the widget, an enabled/disabled option. The widget is only shown when the option reads 'enabled'.

When I update my Widget module in another project, this field is added. However, none of the widgets are shown, because the field 'enabled/disabled' is not yet in the database.

I know that I can programmatically change configuration, using UpgradeData and $this->config>saveConfig('config change');.

Is there a way to set all widgets to 'enabled', programmatically?

(I have tried SQL solutions, but it seems that the widget is generating HTML and Layout in several locations in the database.)


texts:
I recently converted a Magento 1.9 module to be compatible with Magento 2. all was going well until I got this error:

  Object DOMDocument should be created

I'm not experienced enough in Magento and PHP to figure out how to fix this so I linked the converted module below.

magento 1.9 module in question

I put the converted module here on github.


texts:
I have the following in my logs which appeared after updating the M2EPro Module.

  fopen(var/cache/mage--9/mage---33f_m2epro_extension_M2ePro_Config_Module_data): failed to open stream: No such file or lib/Zend/Cache/Backend/File.php

I have tried clearing the cache but there must be something embedded somewhere as the record keeps coming back.

How can I stop Magento trying to create/open the non-existant cache record?


texts: Magento 2 : Rest API get product price including tax

texts:
I have added tax rules to add GST on a product prices.

I have changed the store->configuration->sales->tax->Price Display Setting->Display Product Prices In Catalog to yes. I am getting it correctly on website when there is shipping address associated with quote.

I wanted to do same for the REST API.
Can anyone suggest better approach to accomplish this?


texts: Magento 2: Add custom attributes and set final price 0 in an if statement under product/price/amount/default.phtml

texts:
I've searched for this answer, and no one seems to have answered it. Does anyone know how to handle this?

Here is my current code:

<?php
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$storeInformation = $objectManager->create('Magento\Store\Model\Information');
$store = $objectManager->create('Magento\Store\Model\Store');
$storeInfo = $storeInformation->getStoreInformationObject($store);
$myBlock = $objectManager->get('Freshley\GetProduct\Block\CurrentProduct');
$product = $myBlock->getCurrentProduct();
?>

<?php if($_product->getData('show_price')): ?>
    <?php if($_product->getPriceInfo()->getPrice('final_price')->getValue() == 0): ?>
        <a href="tel:+1<?php echo $storeInfo->getPhone(); ?>">Call for Price!
    <?php else: ?>
        <span class="price-container <?= /* @escapeNotVerified */ $block->getAdjustmentCssClasses() ?>"
                <?= $block->getSchema() ? ' itemprop="offers" itemscope itemtype="http://schema.org/Offer"' : '' ?>>
            <?php if ($block->getDisplayLabel()): ?>
                <?= /* @escapeNotVerified */ $block->getDisplayLabel() ?>
            <?php endif; ?>
            <?php if($_product->getData('priced_starting_at')): ?>

Starting at:

            <?php else: ?>

Our Price:

            <?php endif; ?>
            <span <?php if ($block->getPriceId()): ?> id="<?= /* @escapeNotVerified */ $block->getPriceId() ?>"<?php endif;?>
                <?= ($block->getPriceDisplayLabel()) ? 'data-label="' . $block->getPriceDisplayLabel() . $block->getPriceDisplayInclExclTaxes() . '"' : '' ?>
                data-price-amount="<?= /* @escapeNotVerified */ $block->getDisplayValue() ?>"
                data-price-type="<?= /* @escapeNotVerified */ $block->getPriceType() ?>"
                class="price-wrapper <?= /* @escapeNotVerified */ $block->getPriceWrapperCss() ?>"
            ><?= /* @escapeNotVerified */ $block->formatCurrency($block->getDisplayValue(), (bool)$block->getIncludeContainer()) ?>
            <?php if ($block->hasAdjustmentsHtml()): ?>
                <?= $block->getAdjustmentsHtml() ?>
            <?php endif; ?>
            <?php if ($block->getSchema()): ?>
                <meta itemprop="price" content="<?= /* @escapeNotVerified */ $block->getDisplayValue() ?>" />
                <meta itemprop="priceCurrency" content="<?= /* @escapeNotVerified */ $block->getDisplayCurrencyCode() ?>" />
            <?php endif; ?>

    <?php endif; ?>
<?php endif; ?>

I also try to extend $block with getCurrentProduct using this code:

<?php
namespace Freshley\GetProduct\Block;
class CurrentProduct extends \Magento\Framework\View\Element\Template
{
    protected $_registry;

    public function __construct(
        \Magento\Backend\Block\Template\Context $context,
        \Magento\Framework\Registry $registry,
        array $data = []
    )
    {
        $this->_registry = $registry;
        parent::__construct($context, $data);
    }

    public function _prepareLayout()
    {
        return parent::_prepareLayout();
    }

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

This works just fine on Product Detail pages, but everywhere else that shows the price - I am getting this error:

Fatal error: Uncaught Error: Call to a member function getData() on null in /chroot/home/davidfai/davidfairclough.com/html/app/design/frontend/Freshley/ultimo_child/Magento_Catalog/templates/product/price/amount/default.phtml


texts: How to Remove filter in mobile and tablet view

texts:
I don't need the filter in the list page in device whose width is less than 700px.
I tried using below media query but it didn't work. Is there anything should do further. Kindly help me.

@media only screen and(max-width:771px)
{
 col-left.sidebar{ display:none;}
 }


texts:
When trying to save the config of PayPal module I get the following server error:

  413 - request entity too large

which I think is very strange.

I have searched around and made changes to lighttpd.conf

Has any one else encountered this when making configuration changes?


texts: Magento 2.2.5 : Add video to product programmatically

texts:
I am new in magento. I saw some links about add video programmatically, but I didn't get output which is working perfect.

How to add product video programmatically to the specific product ?

Please guide me.

Thanks.


texts: Magento 1.9 : Configurable Options not showing on product page Issue

texts:
I have a site on Magento 1.9,the product options do not show on the front end for configurable products. It throws the error like this.

  Uncaught TypeError: Cannot read property 'hasClassName' of null

Currently I have not made no changes on the site but I am unable to figure out the exact problem. How do I go ahead.
I have refered to previous answers(link) which mentioned about checking following things in case for product options not shown up on product page. And in my case these all conditions are met and yet I'm stuck on this.

visibilty = not show inidividually
stock = in stock
attribute set = the same as configurable product
price = also set
status = enable


texts:
When I try to login to the admin panel I get a

  404 error

I can access the login page, and if I try to login with a wrong password, I get the

  Invalid User Name or Password

message. If I remove the index.php in the web address after I have tried to login I get access, but I need to do that every time I enter a new page. I have seen some solutions that includes editing the core files, but i don't want to do that...

Anyone who knows how to fix this?


texts: Magento 2: set configurable product option via js

texts:
I would like to automatically set a configurable product option.

I tried to do it via javascript:

<script>
    require(["jquery", "jquery/ui"], function ($) {
        $(document).ready(function(){
            $('#attribute93').val(12).change();
        });
    });
</script>

The hardcoded id and value are for testing purposes only (both do exist).
The problem seems to be that the ready function is called before the dropdown select is completely rendered and ready for user interaction. $('#attribute93').val(12).change(); does work when triggered by a user's click.

Is there a way to tell when everything on a page is completely rendered? I found the afterRender event but that seems to relate to knockout js only.

Thank you


texts:
I can not find any information related to this.

I need to display tax rates with their corresponding amounts.

Now I have like this:

But I would like to show the total of both taxes with their amounts, can anyone advice how to achieve that?

Example:

Subotal: 41.24€
IVA (21%) - x€
RE (5.2%) - y€
Tax - 10.80€
Final price: 52.04€

Thank you very much,

Here's configuration for the taxes in Shopping cart:


texts: Magento Connect Manager > Settings > Deployment Type with SFTP in custom port

texts:
Magento v.1.9.2.4

In Magento Connect Manager > Settings > Deployment Type

Is it possible to use SFTP (instead of FTP) in a custom port?


texts: How to call phtml file in admin block magento 2?

texts:
I have created custom theme and I want to call copyright.phtml file in a block I have created on admin side.
I added this

{{block class="Magento\Framework\View\Element\Template"template="Magento_Theme::copyright.phtml"}}

in my block but it's not working


texts: How to override email/items.phtml and email/items/default.phtml to include product url and thumbnail in magento2.1.3

texts:
I have developed one module in magento-2.1.3. on the name of Shelltag/SalesOrder/. I want to override items.phtml file and default.html from module-sales/ in this. I don't want to edit core file.

So, how to do it?


texts: Magento 2 csv import : do I need to specify a price for the configurable products?

texts:
I'm importing product into Magento 2 with a csv. Do I need to specify a price for the configurable products or can I left the price field blank? My variations are only sizes and the price is the same for each.

I'm currently not specifying it and the import works fine, but I don't want to run into issues later.


texts: Magento2 staging Update work flow question

texts:
Hi I would like to know beside staging_update table, where I can find the related items information? such as I set a schedule special price start date and end date. Where I can find the start date and end date of this item from database?
Thanks


texts: How to call Controller using in AJAX in magento2?

texts:
I want to call ajax in when a customer clicks on place order button.
If a user clicks place order button, that should call js from there it should call Controller?
How to write Controller for that JS  in the checkout page?
Can Anyone Help me?
Urgent.
I don't have an idea where to write controller and return to JS.


texts: Magento2 include external resources before local

texts:
I have the problem, that my external resources gets loaded after my local resources. So I can't override that styles. I have a custom theme and added a default_head_blocks.xml with the following content:

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
    <css src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" src_type="url" />
    <css src="css/test.css" />
</head>

Generated HTML:

<head>
    ...
    <link  rel="stylesheet" type="text/css"  media="all" href="[...]/css/test.css" />
    <link  rel="stylesheet" type="text/css"  media="all" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" />
    ...
</head>

How can I first load the external resources in my head section?


texts: Hiding Thumbnail images from Gallery - SQL Query

texts:
A while ago I had a bad import in a store and hundreds of thousands of thumbnail images got set to show up on product page in Gallery.
Most of the time, you don't want the gallery to show thumbnail images because they are small.
I found a query in other threads on Stackoverflow that updates the attribute for thumbnail not to show up in Gallery.
UPDATE `catalog_product_entity_media_gallery_value`
SET `disabled` = 1
WHERE `disabled` = 0 AND `value_id` IN
(SELECT `value_id` FROM `catalog_product_entity_media_gallery` WHERE `value` IN
(SELECT `value` FROM `catalog_product_entity_varchar` WHERE `attribute_id` = 89));

^^^ FYI attribute_id is specific to my store.
QUESTION: Is there a way to optimize it?
At the scale of small shop this would work, but at scale of 200,000 products this query takes way too long.
From experiments this query starts to slow down with every iteration:
MariaDB [test]> UPDATE `catalog_product_entity_media_gallery_value` SET `disabled` = 1 WHERE `disabled` = 0 AND `value_id` IN ( SELECT `value_id` FROM `catalog_product_entity_media_gallery` WHERE `value` IN ( SELECT `value` FROM `catalog_product_entity_varchar` WHERE `attribute_id` = 89)) LIMIT 100;
Query OK, 100 rows affected (3.805 sec)
Rows matched: 100  Changed: 100  Warnings: 0

MariaDB [test]> UPDATE `catalog_product_entity_media_gallery_value` SET `disabled` = 1 WHERE `disabled` = 0 AND `value_id` IN ( SELECT `value_id` FROM `catalog_product_entity_media_gallery` WHERE `value` IN ( SELECT `value` FROM `catalog_product_entity_varchar` WHERE `attribute_id` = 89)) LIMIT 500;
Query OK, 500 rows affected (12.730 sec)
Rows matched: 500  Changed: 500  Warnings: 0

MariaDB [test]> UPDATE `catalog_product_entity_media_gallery_value` SET `disabled` = 1 WHERE `disabled` = 0 AND `value_id` IN ( SELECT `value_id` FROM `catalog_product_entity_media_gallery` WHERE `value` IN ( SELECT `value` FROM `catalog_product_entity_varchar` WHERE `attribute_id` = 89)) LIMIT 1000;
Query OK, 1000 rows affected (24.233 sec)
Rows matched: 1000  Changed: 1000  Warnings: 0

MariaDB [test]> UPDATE `catalog_product_entity_media_gallery_value` SET `disabled` = 1 WHERE `disabled` = 0 AND `value_id` IN ( SELECT `value_id` FROM `catalog_product_entity_media_gallery` WHERE `value` IN ( SELECT `value` FROM `catalog_product_entity_varchar` WHERE `attribute_id` = 89)) LIMIT 1000;
Query OK, 1000 rows affected (36.559 sec)
Rows matched: 1000  Changed: 1000  Warnings: 0

I have tried rewriting it with JOINS:
UPDATE
    catalog_product_entity_media_gallery_value a
    JOIN catalog_product_entity_media_gallery b ON a.value_id = b.value_id
    JOIN catalog_product_entity_varchar c ON c.value = b.value
SET
    a.disabled = 1
WHERE
    a.disabled = 0
    AND c.attribute_id = 89
LIMIT 1000;

But it also has abysmal performance with every iteration.
If you need to look it up here is a select statement:
SELECT * FROM catalog_product_entity_media_gallery_value a
    JOIN catalog_product_entity_media_gallery b ON a.value_id = b.value_id
    JOIN catalog_product_entity_varchar c ON c.value = b.value
WHERE a.disabled = 0 AND c.attribute_id = 89
LIMIT 1000;

UPDATE:
I have tried messing around with CREATE TEMPORARY TABLE. It seems to be working faster when it's done this way.
CREATE TEMPORARY TABLE new_tbl
SELECT a.value_id FROM catalog_product_entity_media_gallery_value a JOIN catalog_product_entity_media_gallery b ON a.value_id = b.value_id JOIN catalog_product_entity_varchar c ON c.value = b.value WHERE a.disabled = 0 AND c.attribute_id = 89 LIMIT 50000

Then do:
UPDATE catalog_product_entity_media_gallery_value a
    JOIN new_tbl b ON a.value_id = b.value_id
SET a.disabled = 1
WHERE a.disabled = 0;

I would still like to do this in one query though.
UPDATE:
I compared two queries (IN vs JOINS) and JOINS are definitely faster:
IN

VS
JOINS

I'm looking into stored procedures next to see if it can speed up the processing.


texts:
i'm using a dedicated server with SSD and 16gb memory and 2.4 8 cores server and plesk panel, php7 with apache server.

fresh magento 2.1.5 installation, any click or request on the store makes magento utilizing the CPU 99 or 100% which makes the server hung and the store also.


texts: Change Product Price That effects the price range in Layerd Navigation

texts:
I change the product price by custom rules in custom module. By the Event <catalog_product_collection_load_after>
for product list page. And for product view page I override the getPrice() Method of the
Mage_Catalog_Model_Product_Type_Price.

My Problem is that price is changed according to the custom rules. But Price slider range is not updated. I also rewrite the layer model and prepareProductCollection() function but nothing change in price range. Price slider is still works on the product price. Not on my custom price. My question is how to change the product price that it effects price ranges. I not want to save the price in product table. I want to change the price like Magento Catalog Rule Change the Price.


texts: Magento 2: How does the category tree/node work?

texts:
I must admit that I am having trouble understanding the category tree/node thing in magento. I have extended the Topmenu class to build my own supermenu. It works fine except the category children are always sorted by their id instead of the defined sort order.

So I tried to dig into this but I simply cannot wrap my head around how magento actually pulls and organizes the categories from the database. It all boils down to this function:

public function getMenu()
{
    if (!$this->_menu) {
        $this->_menu = $this->nodeFactory->create(
            [
                'data' => [],
                'idField' => 'root',
                'tree' => $this->treeFactory->create()
            ]
        );
    }
    return $this->_menu;
}

Somehow magento magically comes up with the categories here. Nowhere I see the typical collection which I could understand.

So my question is: can someone please explain to me how this tree/node thing works and how magento pulls the categories from the database? And in addition to that: how can I manipulate it to my needs? As mentioned I need to get the children sorted by sort order instead of their ids.


texts:
How do I get the Shopping cart discounts?
For a payment integration I need to sent all items in cart.
For products that is easy, but how do I get the following for all applied discounts:

amount with and without tax
name
vat%


texts:
I am using magento 1.9.1.0. I had continously trouble with modules which throw notice warnings which in turn broke some functionality. So I've managed to ignore Notice Warnings by putting error_reporting(E_ALL ^ E_NOTICE); in index.php, get.php and api.php.

Before that I managed to handle these errors with my own handler in index.php

set_error_handler('noticeErrorHandler', E_NOTICE | E_STRICT) ;

function noticeErrorHandler($code, $err_msg, $err_file, $err_line, array $err_context) {
  $error = $log = null;
  switch ($code) {
    case E_NOTICE:
    case E_USER_NOTICE:
      $error = 'Notice';
      break;
    case E_STRICT:
      $error = 'Strict';
      break;
  }

  Mage::Log($error . ": " . $err_msg . " in " . $err_file . " on line " . $err_line, null, "notices.log");
}

But Mage::Log is not working before Mage::run and it is not really a nice solution to put this in index.php.

My question is: is there a nice solution to prevent Magento from raising errors for notice warnings and put them in an own notices.log file for every site request, like api requests too?

Thanks!


texts: Magento2 : Issues in default Enterprise Edition RMA extension

texts:
I am facing some issues in Magento2 EE default RMA extension.

In create new return under "Return item information".

1) Form is not getting validated: reason to order, item condition, resolution are required yet form gets submitted and request is created.

2) On "Add item to return": I do not found any option to delete that added item.

3) On successful submitting RMA form getting error : "We can't create a return right now. Please try again later.".

Has anyone else have faced same issue.

Any help.

[edit]:

Figured out the 3 rd point, this error is occurring as sendNewRmaEmail() function is called on creating rma. So as emails were not been send so it was throwing error. But yet first two problems still persists.


texts:
I have already followed this question for front-end validation of PostCode : Zip/Postal Code validation not working properly

How can i add a server-side validation? Thank you.


texts: Programmatically create a Smart Category Rules

texts: I was following this guide from inchoo for programmatically creating 50+ categories, but then I discovered this Enterprise feature, “Smart Category Rules”, and would like to use this approach instead. My question is, how do I create these smart categories programmatically using a script?


texts:
I set up a sample store, uploaded 3 products, then uploaded 1 STL file for each product. They were stored in database successfully.
In files table, it is like this.

And in catalog_product_entity_varchar table, the attribute_id is 71 for all 3 products.
So when I click on Click Here To View Associated STL file in STL viewer link as shown in below screen shot, then STL image from files table should load into STL viewer which is in another web page.

How to access the STL file from files table?
This code is incomplete, help me to complete it.

$resource=Mage::getSingleton('core/resource');
$readConnection=$resource->getConnection('core/resource');
$table=$resource->getTableName('files');
$query="select * from '. $table .' where file_id/prod_id ='value'";
$result=$resource->fetchcol($query);


texts: Magento 2: How to show custom customer attribute value in an order report in the admin

texts:
I am trying to create a custom order report to show some customer information along with the order details. I have created few custom attributes for Customer. The report is very similar to the default Magento report Magento/Sales/Model/ResourceModel/Report/Invoiced/Collection/Order.php. But I need to join the custom customer attributes to this report.
I have an attribute named my_custom_customer_attribute and it has got some value for a particular customer. When I generate an order report, I need to show this value along with the order number, customer name, order total and ``my_custom_customer_attribute`. I am extending the above Order report. So I need a way to join the custom attribute to the Collection.
Please could someone point me in the right direction.
Thanks


texts: Configurable Product Options Randomly Empty in Frontend

texts:
On Magento 2.3.6-p1 we have an issue where customers cannot select a product's options because the options list is empty.
This is very inconsistent since different products with the same option attribute sometimes show the options list and sometimes don't.
Here is an example for an empty options list:

This is a working options list for the exact same options attribute:

Both products are identical besides the pictures and names.
It seems that just very seldomly options are shown for a product when most of the time it does not work; the reason for this is not known to me.
The problem exists since we upgraded from Magento 2.3.0 to 2.3.6-p1.
This issue has a heavy impact since most products sare sold as configurable products which customers are currently unable to buy. (My wife is killing me!)
Besides obvious hints like clearing caches, reindexing or making sure the products are in stock I found neither a solution nor any direction to look for to solve the problem. The server logs show no irregularities, the Magento cron job is running fine.
Any help is appreciated!
Edit 1: I was told that this issue already sometimes happened on Magento 2.3.0 but not as often.
Edit 2: I found a JS error which happens on the site when the page loads in this script:
    <script type="text/javascript">
    require(['jquery', 'jquery/ui', 'domReady!'], function($) {
        $('body').on('updatePrice', function (e, data) {

            var swatchWidget = $('.swatch-opt').data('mage-SwatchRenderer');
            if(swatchWidget) {
                var options = _.object(_.keys(swatchWidget.optionsMap), {});

                swatchWidget.element.find('.' + swatchWidget.options.classes.attributeClass + '[option-selected]').each(function () {
                    options[$(this).attr('attribute-id')] = $(this).attr('option-selected');
                });
                result = swatchWidget.options.jsonConfig.optionPrices[_.findKey(swatchWidget.options.jsonConfig.index, options)];
            } else {
                var configurableWidget = $('#product_addtocart_form').data('mage-configurable');

                var options = {};

                configurableWidget.element.find(configurableWidget.options.superSelector + ' option:selected').each(function () {
                    if($(this).val()) {
                        options[Number($(this).parent().prop('id').replace('attribute', ''))] = $(this).val();
                    }

                });

                var config = configurableWidget.option('spConfig');
                result = config.optionPrices[_.findKey(config.index, options)];
            }

            var basePriceField = $('.product-info-price .baseprice');
            if (typeof result != 'undefined' && result.magenerds_baseprice_text.length && basePriceField.length) {
                basePriceField.html(result.magenerds_baseprice_text);
            }
        });
    });
</script>

The script seems to be responsible for rendering the options. The error happens in the line configurableWidget.element.find(configurableWidget.options.superSelector + ' option:selected').each(function () {: Uncaught TypeError: Cannot read property 'element' of undefined
This indicates that something goes wrong in the line var configurableWidget = $('#product_addtocart_form').data('mage-configurable');.
The selected ID is definitely in the page, probably the data assigned to this element are missing.
Edit 3: I found out some weird behaviour in which for some products the selectable options list is already populated in the HTML document sent by the server. Those products work just fine. The HTML documents do not contain the script mentioned above!
Then there are pretty much identical products with the same option where the options list seems to be populated dynamically with the help of the script shown above. In those cases no option selection is possible.
I do not see any reason why products are handled differently


texts: Magento 2 custom sort option with elastic search

texts:
I have to implement below custom sort options
– Order: A to Z
– Order: Z to A
– Price: Low to High
– Price: High to Low

I have tried with the example given in link. This is not working with elastic search. I am getting a message

We can't find products matching the selection.

Please help me if anyone has implemented this.


texts: Magento Success/Failure Message for the Form Submission using Javascript

texts:
I am submitting the form to edit primary shipping and billing addresses via ajax (2 forms, 1 page), and it finally works like it has to. Now, I'd just like to add messages that magento sets for those forms, to display as soon as form is submitted, without page reload.
Can i retrieve those messages somehow with javascript?

If not, how do i disabled setting the messages for editing primary shipping and billing addresses forms? Because now the messages dont show on same page, but when i visit another page, they show up.

Much appreciated,
- Magento newbie


texts: Is it possible to do online refund with paypal in magento communtiy. if yes, which paypal api supports this feature in magento and how can i use that?


texts: Any other caching than var/cache? / Flush Magento Cache works, rm -rf var/cache not

texts:
We did an update on production but still a translation which was newly defined in a translate.csv file did not work.

After rm -rf var/cache it still was not shown. We verified that the folder is empty. /tmp/magento also did not exist. After refreshing the page var/cache got filled again - so it is in fact used.

We were able to make it work by Flush Magento Cache in the backend - how can this be? Where else might the translation be cached?

edit

We found this in the local.xml

    <cache>
    <backend>apc</backend>
    <prefix>APC_</prefix>
    </cache>

The question is why Magento still writes to the cache folder.


texts:
I'm building rest API to clear compare items list

here is code I'm using

  /**
* @api
*
* @return int
*/
public function clearItems(){
    $userType = $this->userContext->getUserType();
    $id = $this->userContext->getUserId();

    if($userType === UserContextInterface::USER_TYPE_CUSTOMER){
        $this->collection->setCustomerId($id);
    }
    else if($userType === UserContextInterface::USER_TYPE_GUEST){
        $this->collection->setVisitorId($id);
    }
    $this->collection->setCustomerId($id);

    $this->collection->clear();

    return $id;
}

but it's deleted only from database and stay in the store. and when open the compare list from the store it returned again to database
and returned id is differ from the logged in user id


texts: Magento 2 add to cart programmatically not working

texts:
Here am have a custom api at that API call am trying to add a product to cart but am not getting it.

namespace Vendor\Cart\Model;
  use Magento\Framework\Data\Form\FormKey;
  use Vendor\Cart\Api\HelloInterface;
  use Magento\Framework\View\Result\PageFactory;
  use Magento\Framework\Event\Observer;
  use Magento\Framework\Event\ObserverInterface;
  use Magento\Quote\Model\QuoteRepository;
  use Magento\Checkout\Model\Session as CheckoutSession;

class Hello implements HelloInterface
{

        protected $cart;
        protected $formKey;
        protected $request;
        protected $_wishlistRepository;
        protected $_productRepository;
        protected $_sellerCollection;
    public function __construct(
    \Magento\Checkout\Model\Cart $cart,
    FormKey $formKey,
    \Magento\Quote\Api\CartRepositoryInterface $quoteRepository,
    \Magento\Quote\Model\QuoteFactory $quoteFactory,
    \Magento\Catalog\Api\ProductRepositoryInterface $productRepository
    {
     $this->cart = $cart;
     $this->formKey = $formKey;
     $this->quoteRepository = $quoteRepository;
     $this->quoteFactory = $quoteFactory;
     $this->productRepository = $productRepository;
    }
     public function new(){
     $QuoteId=636;
     $quote = $this->quoteFactory->create()->load($QuoteId);
     $d = $quote->getData();
     $quoteId = $d['entity_id'];
     //***********************************     */

     $quote = $this->quoteRepository->get($QuoteId);
     $items = $quote->getAllItems();

     $params = array(
          'form_key' => $this->formKey->getFormKey(),
          'product' => 37,
          // 'sku' => 'SKU590003557',
          'quote_id' => $quoteId,
          'qty' => 1
      );
     $product = $this->productRepository->getById(37);
     /****************************************** */

     $this->cart->addProduct($product,$params);
     $this->cart->save();
   }
}

Where am doing wrong?. can i get help? Thank you in advance


texts: Get tracking info from order/shipment object

texts:
How can I get the shipment tracking information from shipment or order object in magento2. Following ways doesn't work for me.

$shipment->getTrackingInfo();

$order->getTrackingInfoByOrder();


texts: Media main image not changes with swatches magento 2.0.2

texts:
I have facing some issues with configurable product. when i click on swatches main image not changed. my magento is 2.0.2.

can you please help to resolve the issue. thanks


texts:
I read many about problems with setup magento CRON but I don't find something about this error message with putty ssh connection:

Error during saving of crontab: sh: line 6: crontab: command not found

It is a new Magento 2.2.6 installation.

Where is my mistake?

With Mag 1.9 I had zero problems to activate the CRON. But the Mag 2 seems very complicated.


texts: How to get url of product full image with multistore?

texts:
$categories = Mage::getModel('catalog/category')
    ->getCollection()
    ->setOrder('entity_id', 'DESC')
    ->setStoreId($storeId)
    ->addAttributeToSelect('name');

// For each category do
foreach ($categories as $_category) {
    // Get products collection and add attributes to select
    $products = $_category->getProductCollection();

    // For each product do
    foreach ($products as $_product) {
       $storeId = 14;
       $product = Mage::getModel('catalog/product');
       $product->setStore($storeId);
       $product->load($_product->getId());
       if (is_object($product)) {
           $imageObj = Mage::helper('catalog/image')->init($_product, 'image');
           $urlIm = $imageObj->__toString();
           $imageUrl[] = $urlIm;
           var_dump($imageUrl);
           exit;
       }
    }
}

I tried to get url's of cached product full images for store 14, but always receiving url's for store 0.


texts: Modify Changes to core files to stay even after Magento Updates

texts: I made changes to Magento Core files recently but those changes were overridden after a minor update to Magento CE 1.9.2.4 from version 1.9.2.3. Now I have to do those changes again. These are mandatory changes for my store and are required to make Rupee (Indian Currency) Symbol appear in Magento Invoices. Default Font does not support the symbol. How can I make those changes to stay permanent in the core file?


texts: Magento 2: save item options in quote(quote_item_option)

texts:
I need to add new option for item.

Now in quote_item_option i have:

{"id":"54","product":"54","selected_configurable_option":"","related_product":"","options":{"4":""},"qty":"1"}

But wanna {"id":"54","product":"54","selected_configurable_option":"","related_product":"","options":{"4":"", "new_option":"some_value"},"qty":"1"}

I created following controller:

<?php

   namespace MySpace\SomeModule\Controller\Quote;
    class Index extends \Magento\Framework\App\Action\Action
    {
        /**
         * @var \Magento\Framework\Controller\Result\JsonFactory
         */
        protected $resultJsonFactory;

        /**
         * @var \Magento\Checkout\Model\Session
         */
        protected $checkoutSession;

        /**
         * Update constructor.
         * @param \Magento\Framework\App\Action\Context $context
         * @param \Magento\Framework\Controller\Result\JsonFactory $resultJsonFactory
         * @param \Magento\Checkout\Model\Session $checkoutSession
         */
        public function __construct(
            \Magento\Framework\App\Action\Context $context,
            \Magento\Framework\Controller\Result\JsonFactory $resultJsonFactory,
            \Magento\Checkout\Model\Session $checkoutSession
        ) {
            parent::__construct($context);
            $this->resultJsonFactory = $resultJsonFactory;
            $this->checkoutSession = $checkoutSession;
        }

        /**
         * @return \Magento\Framework\Controller\Result\Json
         */
        public function execute()
        {
            $a = 3;
            $itemId = (int) $this->getRequest()->getParam('item_id');
            $orderNoteEnabledValue = (string) $this->getRequest()->getParam('new_option');

            if ($itemId && $newOptionValue) {
                $quote = $this->checkoutSession->getQuote();
                /** @var \Magento\Quote\Model\Quote\Item $item */
                foreach ($this->checkoutSession->getQuote()->getItems() as $item) {
                    if ((int)$item->getItemId() !== $itemId) {
                        continue;
                    }
                    $buyRequest = $item->getBuyRequest();

                    $options = $buyRequest->getData('options');
                    if (!$options) {
                        $options = [];
                    }
                    $options['new_option'] = $newOptionValue;
                    $buyRequest->setData('options', $options);

                    $quote->updateItem($itemId, $buyRequest);
                    $quote->save();

                    break;
                }
            }

            return $this->resultJsonFactory->create()->setData(['message' => 'Error']);
        }
    }

I debugged, script getts data(option value) successfully, modified it also, but not saving option with new field to table.

What is issue or my mistake?

Thanks for any halp and advise:)


texts: Admin Error after Update: Specified invalid parent id (Magento_Analytics::business_intelligence)

texts:
After upgrading from 2.1.17 to 2.1.18, I'm receiving this error when accessing the admin panel:

Specified invalid parent id (Magento_Analytics::business_intelligence)";i:1;s:3699:"<pre>#1 Magento\Backend\Model\Menu\Builder\Interceptor->___callPlugins() called at [var/generation/Magento/Backend/Model/Menu/Builder/Interceptor.php:39]

I can't find any references to Magento_Analytics in the codebase. Any ideas on how to fix this?

Edit: information on the Magento_Analytics module might be helpful as well, if anyone knows why this might be referenced somewhere in 2.1.18


texts: I'm trying to import customers to a Magento 2 website. Data validation is OK (File is valid! To start import process press "Import" button), but when I click on import button  I get error.


texts: Magento 2: Watching changes in env.php file

texts: Is there any way to watch changes in env.php file? I would like to log all changes into some file.


texts: Changing Dropdown attribute to text in magento 1.9 without changing data

texts:
In Magento 1.9, I am going to convert my drop-down attributes to text field without changing my current data

Below is the image of current attribute set


texts: What performance testing tools would you recommend?

texts:
I am looking for a performance testing tool to help with development regarding
performance enhancing changes. What I need is to be able to make a series of changes and be able to see if the response time is heading down or not.

I have heard of, and experimented with JMeter, Gatling, Siege etc.

I am not interested in load testing the application at this point, more just a small average to see if the code is more efficient or not. When I talk about changes I am only referring to code relating changes, not hardware / enviroment

Also what I am interested in with this is the reporting that comes with it, I ideally want some simple graphs, tables etc to represent the data.

Any recommendations would be most appreciated.


texts:
Can't login admin page after upgrade from 1.9.2.1 to 1.9.2.2
After entering address: "index.php/admin" redirects me to default 404 error store page.
I cleaned Magento Cache and browser. Redirects work properly on all web pages of store. It does not work only "admin"
Please help solve this problem.


texts: Error while migrating from Magento 1.9 CE to Magento 2.1 CE

texts:
Integrity check failed error after Stores Step. Can any one help me how to resolve this, below is my migration command.

   user@comp:/var/www/html/magece21$ sudo php -f bin/magento migrate:settings vendor/magento/data-migration-tool/etc/ce-to-ce/1.9.0.1/config.xml
settingsnamee
[2016-11-01 06:35:11][INFO][mode: settings][stage: integrity check][step: Settings Step]: started
[2016-11-01 06:35:11][INFO][mode: settings][stage: integrity check][step: Stores Step]: started
100% [============================] Remaining Time: 1 sec

  [Migration\Exception]
  Integrity Check failed


texts: Magento coupon codes - only one coupon / guest customer

texts:
I'm using magento 1.7 and I have the following issue with coupon codes.
I've set up a cart rule which uses a coupon code. I want customers to be able to use this coupon only once, so I set up Uses per Customer to 1. For logged in customers the rule works, and they can use the coupon only once for an order, if they try to place another order using the same coupon code they get an error, which is the correct behaviour.
The problem is that I need GUEST (NOT LOGGED IN) customers to use the same coupon code, and for them the rule for 1 use per customer doesn't work. I've tested it and I can place an unlimited number of orders using the same coupon code. Is there any way to check if a guest customer has already placed an order using a coupon code? Any help will be greatly appreaciated.

Thanks.


texts: Why registry class in my controller breaks my page?

texts:
I tried to inject a registry class in my controllers constructor, without this registry class, it works (the die('Ok') is displayed ) but when I add the class, it breaks my page, I mean (I have a white page without any error or log) ?
For More info: I'm in developer mode, the other errors are well displayed but not this one, I don't know if there is really an error or not I don't know !

php bin/magento deploy:mode:show
output
Current application mode: developer. (Note: Environment variables may override this value.)

class Index extends \Magento\Framework\App\Action\Action
{
    protected $_resultPageFactory;
    protected $_coreRegistry;

    public function __construct
    (
        \Magento\Framework\App\Action\Context $context,
        \Magento\Framework\Registry $coreRegistry,
        \Magento\Framework\View\Result\PageFactory $resultPageFactory
    )
    {
        $this->_coreRegistry = $coreRegistry;
        $this->_resultPageFactory = $resultPageFactory;
        parent::__construct($context);
    }

    public function execute()
    {
        die('Ok');
    }
}


texts:
I am trying to implement Product exchange functionality where in case customer order for wrong color/size, he can request for correct one to admin.

In this case, I would like to let admin change status of that product from Shipped to let's call Exchanged and then admin can put new order on behalf of customer for correct product.

I am not able to find code to change order item status. I can find code to change Order status but that's not required in this case.

Any idea how to do this? or any easier way to implement this?


texts:
I have a question regarding how Magento 2 Less handles _extend.

According to the documentation http://devdocs.magento.com/guides/v2.0/frontend-dev-guide/css-guide/css_quick_guide_approach.html I can extend a specific component vs overwriting it.

I have a child theme that I'm using Magento/Blank as a parent. I also have a second theme that uses my child theme and I use that for specific category styling.

If I follow the instructions in the documentation and create a file

web/css/source/_navigation_extend.less

and add _navigation_extend.less

to _extend.less, it shows up properly on my child theme. The problem is those same styles aren't applied to my grandchild theme.

Is there something I'm doing wrong? Is there a way to make it work? Thanks!


texts:
When I run the command php bin/magento setup:di:compile I am getting an error as below

  PHP Fatal error:  Uncaught Error: Cannot instantiate interface Symfony\Component\Console\Output\OutputInterface in /vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:111


texts: How to set the default option in existing dropdown attribute

texts:
How do I set an option in a dropdown attribute as the default? I am adding the options to an existing attribute with this code where $aName is an array of names.

$installer = new Mage_Eav_Model_Entity_Setup('core_setup');
$installer->startSetup();
$aName = array("Name1", "Name2");

$aOption = array();
$aOption['attribute_id'] = $attr_id;

for($iCount=1;$iCount<sizeof($aName);$iCount++){
        $aOption['value']['option'.$iCount][0] = $aName[$iCount];
        $aOption['order']['option'.$iCount] = $iCount   ;
}

$installer->addAttributeOption($aOption);
$installer->endSetup();

I think the answer is in Stackoverflow here but I don't know how to apply it. In my case the Attribute exists, I'm just updating the option list and setting the default.


texts: can we have multiple branch with one database on magento2 cloud?

texts:
on Magento cloud when we create a new branch we have to have new database and instance but it is not efficient, we should be able to have different branches using same database, is it possible? I know that we can have them on local and merge to our branch but this is not acceptable I mean I want to take test a branch on cloud why should I setup environment and database again and again?

can we push the changes on cloud branch without rebuilding again when we change the composer? it is taking us 10 minuets for every deployment.


texts: How to Add checkboxes for default billing/shipping address and show as check/uncheck

texts:
Currently Billing and Shipping address don't have checkboxes to
select, to change it from Billing to Shipping or Shipping to Billing.
It only shows a message info.
So, I want to be checkboxes as same as an additional address form.
So that user change

Billing Address -> Shipping Address
Shipping Address -> Billing Address

The problem is how can I get the Use as my default billing address checkbox selected when the user edits Billing Address and vice versa for Shipping Address.
Old Code
 <?php if ($block->isDefaultBilling()): ?>

            <?= $block->escapeHtml(__("It's a default billing address.")) ?>

    <?php elseif ($block->canSetAsDefaultBilling()): ?>

            <input type="checkbox" id="primary_billing" name="default_billing" value="1" class="checkbox">

                <?= $block->escapeHtml(__('Use as my default billing address')) ?>

    <?php else: ?>
        <input type="hidden" name="default_billing" value="1">
    <?php endif; ?>
      <input type="hidden" name="default_billing" value="1" />
  <?php endif; ?>

Changed Code
 <?php if ($block->isDefaultBilling()): ?>

            <input type="checkbox" id="primary_billing" name="default_billing" value="1" class="checkbox">

                <?= $block->escapeHtml(__('Use as my default billing address')) ?>

    <?php elseif ($block->canSetAsDefaultBilling()): ?>

            <input type="checkbox" id="primary_billing" name="default_billing" value="1" class="checkbox">

                <?= $block->escapeHtml(__('Use as my default billing address')) ?>

    <?php else: ?>
     <input type="hidden" name="default_billing" value="1" />
  <?php endif; ?>


texts: Magento 2: Is it possible autoload Factories into PhpStorm?

texts: I have loaded Magento 2 files and XML validation into PHPStorm which is very convenient. Is it also possible to do this (automatically) with factory classes and maybee other generated files? Since they are autogenerated in /var/generation PHPStorm does not recognize it by default and highligts them as "undefined".


texts:
i have magento 2.3

i restored databse and copy all file in directory of server 1   to    server 2

change the  name and  username and  password for database  from env.php

remove all file from  var/cache

after load frontend see [An error has happened during application run. See exception log for details.]
this from exception.log
[2020-10-27 18:20:05] main.CRITICAL: SQLSTATE[28000] [1045] Access denied for user 'u9794712_i5762828_mg2'@'localhost' (using password: YES) {"exception":"[object] (Zend_Db_Adapter_Exception(code: 1045): SQLSTATE[28000] [1045] Access denied for user 'u9794712_i5762828_mg2'@'localhost' (using password: YES) at /home/u9794712/public_html/vendor/magento/zendframework1/library/Zend/Db/Adapter/Pdo/Abstract.php:144, PDOException(code: 1045): SQLSTATE[28000] [1045] Access denied for user 'u9794712_i5762828_mg2'@'localhost' (using password: YES) at /home/u9794712/public_html/vendor/magento/zendframework1/library/Zend/Db/Adapter/Pdo/Abstract.php:128)"} []
how to solve this probleme


texts:
I have a couple cron jobs in my module

The problem is that the Magento cron doesn't run one of them, but runs the another one. I have already installed AoeScheduler and that allows to me to run these jobs manually. When I do that both of them run well.

So the only problem is when it runs through cron.php or cron sh. Also I can see that there's no new row on cron_shedule tab about this job.

This is my cron configuration y config.xml

        <validoc_bulksync_import_exigoprofile>
            <run><model>validoc_exigobulksync/cron::processImportProfile</model></run>
        </validoc_bulksync_import_exigoprofile>
        <validoc_bulksync_import_exigoitem>
            <run><model>validoc_exigobulksync/cron::processImportJobs</model></run>
        </validoc_bulksync_import_exigoitem>
    </jobs>
</crontab>

Im using a model class to suply the needed configuration for those jobs, just like i'd working with cron_path.

  Validoc_Exigobulksync_Model_Adminhtml_System_Config_Backend_Exigobulksync_Cron extends Mage_Core_Model_Config_Data
  {
  const CRON_STRING_PATH = 'crontab/jobs/validoc_bulksync_import_exigoprofile>/schedule/cron_expr';

  const CRON_STRING_PATH2 = 'crontab/jobs/validoc_bulksync_import_exigoitem/schedule/cron_expr';

  protected function _afterSave()
  {
  $minute1 = $this->getData('groups/sheduleprofile/fields/minute/value');
  $hour1 = $this->getData('groups/sheduleprofile/fields/hour/value');
  $minute2 = $this->getData('groups/sheduleimport/fields/minute/value');
  $hour2 = $this->getData('groups/sheduleimport/fields/hour/value');

  $frequencyDaily = Mage_Adminhtml_Model_System_Config_Source_Cron_Frequency::CRON_DAILY;
  $frequencyWeekly = Mage_Adminhtml_Model_System_Config_Source_Cron_Frequency::CRON_WEEKLY;
  $frequencyMonthly = Mage_Adminhtml_Model_System_Config_Source_Cron_Frequency::CRON_MONTHLY;

  $cronDayOfWeek = date('N');

  $cronExprArray = array(
  $minute1,                                   # Minute
  $hour1,                                   # Hour
  (frequency == $frequencyMonthly) ? '1' : '',       # Day of the Month
  '',                                                # Month of the Year
  (frequency == $frequencyWeekly) ? '1' : '',        # Day of the Week
  );
    $cronExprArray2 = array(
       $minute2,                                   # Minute
      $hour2,                                   # Hour
     (frequency == $frequencyMonthly) ? '1' : '',       # Day of the Month
         '',                                                # Month of the Year
         (frequency == $frequencyWeekly) ? '1' : '',        # Day of the Week
    );

  $cronExprString = join(' ', $cronExprArray);
  $cronExprString2 = join(' ', $cronExprArray2);
  try {
  Mage::getModel('core/config_data')
  ->load(self::CRON_STRING_PATH, 'path')
  ->setValue($cronExprString)
  ->setPath(self::CRON_STRING_PATH)
  ->save();
  }
  catch (Exception $e) {
  throw new Exception(Mage::helper('cron')->__('Unable to save the cron expression.'));

  }
     try {
        Mage::getModel('core/config_data')
           ->load(self::CRON_STRING_PATH2, 'path')
          ->setValue($cronExprString2)
         ->setPath(self::CRON_STRING_PATH2)
        ->save();
  }
  catch (Exception $e) {
    throw new Exception(Mage::helper('cron')->__('Unable to save the cron expression.'));

}

  }
  }