texts: Redirect issue after add to cart in magento2 custom controller

texts:
I am calling my custom controller for adding the product through the form action.

Below is my controller file.

  <?php

  namespace {Vendor}\{Module}\Controller\Product;
  use Magento\Framework\Controller\ResultFactory;
 class AddProduct extends \Magento\Framework\App\Action\Action
{
 protected $formKey;
 protected $cart;
 protected $product;
 protected $checkoutSession;
 public function __construct(
  \Magento\Framework\App\Action\Context $context,
  \Magento\Framework\Data\Form\FormKey $formKey,
  \Magento\Checkout\Model\Cart $cart,
  \Magento\Catalog\Model\ProductFactory $product,
   \Magento\Checkout\Model\Session $checkoutSession,
   array $data = []) {
   $this->formKey = $formKey;
   $this->cart = $cart;
   $this->product = $product;
   $this->checkoutSession = $checkoutSession;
   parent::__construct($context);
  }

 public function execute()
{
 $productId = 1;
 $customPrice = 150;
 $params = array(
  'form_key' => $this->formKey->getFormKey(),
 'product_id' => $productId, //product Id
 'qty'   => 1 //quantity of product
 );

$_product = $this->product->create()->load($productId);
$this->cart->addProduct($_product, $params);

 $productItem = $this->getProductQuote($_product);
 $productItem->setCustomPrice($customPrice);
 $productItem->setOriginalCustomPrice($customPrice);
  //Enable super mode on the product.
  $productItem->getProduct()->setIsSuperMode(true);
  $this->cart->save();

   $resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT);
    $resultRedirect->setUrl('http://localsite/checkout/cart');
    return $resultRedirect;
}

public function getProductQuote($product)
{
 $quote = $this->checkoutSession->getQuote();
 $cartItems = $quote->getItemByProduct($product);
 return $cartItems;
 }
}

After $this->cart->save(); , I am redirecting to checkout page

So Product is not adding to the cart, Issue exists in Chrome browser. Mozilla it's fine.

I am getting 302 not found status code in the request. May this be the reason

Can anyone look into this and update me, please. Thanks


texts: How to add custom media gallery upload functionality in magento2?

texts: I need to add a custom multiple image upload functionality in magento 2... How to add it in admin side ?


texts: Fatal error: Call to a member function count() on a non-object Magento 1.9

texts:
any help identifying the error will be highly appreciated.

on magento admin I getting the following error message when trying to access the payment methods. "Fatal error: Call to a member function isSandbox() on a non-object in Block/System/Config/Forms/Checkbox.php on line 13"

Here is the code for Checkbox.php:

class Paguelofacil_Pagocash_Block_System_Config_Forms_Checkbox extends Mage_Adminhtml_Block_System_Config_Form_Field
{
    protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
    {
        $cvalue = Mage::getModel('Gateway/Config_Settings')->isSandbox();
        $checkActive = (Mage::getModel('Gateway/Config_Settings')->isSandbox()==1)?'checked':'';
        $html = "
        <input type='hidden' value='".$cvalue."' id='payment_Pagocash_sandbox' name='groups[Gateway][fields][sandbox][value]'>
       <input type='checkbox' class='select' onclick='pagueloFacilChange(this)' ".$checkActive."> Habilitado PagoCash Sandbox
       <script type='text/javascript'>
            function pfpagoCashChange(currentElement)
            {
                document.getElementById('payment_Pagocash_sandbox').value = (currentElement.checked)?1:0;
            }
       </script>
       ";
        //}

        return $html;
    }
}


texts: Custom attribute Show in order summary on shipping page but disappear on paymeny page

texts:
I have add custom attribute in order summary, it show on checkout first page (#shipping) when shipping method select and go for second page of checkout (#payment) then custom attribute disappear.
I am render custom attribute by using after plugin of this method Magento\Checkout\Model\DefaultConfigProvider::getConfig
my code is

  di.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<type name="Magento\Checkout\Model\DefaultConfigProvider">
        <plugin name="AddAttPlugCOnfig" type="Magerex\Configurator\Plugin\Cart\Summary\DefaultConfigProvider" />
    </type>
    </config>

  Magerex\Configurator\Plugin\Cart\Summary\DefaultConfigProvider

namespace Magerex\Configurator\Plugin\Cart\Summary;

class DefaultConfigProvider extends \Magento\Framework\Model\AbstractModel
{
    public function afterGetConfig(\Magento\Checkout\Model\DefaultConfigProvider $subject, array $result)
    {
        $items = $result['totalsData']['items'];
        $Quote = $result['quoteItemData'];
        $index = 0;
        foreach ($items as $idx => $item) {
            $configOption = null;
//            foreach ($Quote as $quoteItem) {
            $decodeJson = json_decode($Quote[$index]['configurator_params'], true);
            $index++;
            if (isset($decodeJson["productDetails"])) {
                foreach ($decodeJson['productDetails']  as $key => $value) {
                    if ($key == 'productImage') {
                        continue;
                    }
                    $configOption.= $key. " : " .$value .' ';
                }
            }
            $items[$idx]['configurator'] = $configOption;
        }

//        }

        // Update the  current items array
        $result['totalsData']['items'] = $items;

        return $result;
    }
}

  requirejs-config.js

var config = {
    map: {
        '*': {
            'Magento_Checkout/template/summary/item/details.html':
                'Magerex_Configurator/template/summary/item/details.html'
        }
    }
};

Add this line in

  details.html

<span class="c-minicart__highlight" data-bind="text: $parent.configurator"> </span>

  Screenshot for shipping page

  Screenshot second page of checkout  #payment page

.

Please anyone know what the mistake i did, guid me.
Thank you.


texts:
I have installed Magento 2.2.3. For some reason, the meta title disappears from the home page randomly without anyone touching it. I suspect it changes when updating Magento mode. Please reply with your suggestion.

Your help will be greatly appreciated. Looking forward to your reply.


texts: Search troubles, origin of setIsProcessed caller?

texts:
Issue 0:

Plain old catalog search returns no results; I've exhausted all the hints online, caching and attributes, etc, looked at MANY postings here and on Google.  (vanilla install of CE 1.8 with custom data submitted via REST; but even items with no category are allowed to be displayed)

So I finally started putting Mage::log() statements everywhere to track it down.

Issue 1:

I noticed the query logic checks for !getIsProcessed(), and skips the search if it's already been done, which seems reasonable.

But the problem is that "is_processed" => 1 is in every place I check the query object, and I can't figure out why.

So this seems to be the primary problem: is_processed is always 1.  (I realize it's referenced multiple times as a page is rendered, it's set to 1 even on the first time, and YES caching is off)

Issue 2:

I had an idea to print a stack trace from setIsProcessed, whenever the value is set to 1, so I could find the culprit.

But I don't see where setIsProcessed is defined?  I followed back through the classes, Query -> Abstract -> Varien Object, etc. and don't see where it's defined.  It's mentioned in the comments, and certainly called.

My other idea was to just override it in Query but I never see this message in the logs.  (I didn't bother adding the if 1 and stack logic since it's not called at all)

    public function setIsProcessed( $i ) {
            Mage::log( "*** QUERY setIsProcessed called ***" );
            parent::setIsProcessed( $i );
    }

Thanks (and yes, I'm somewhat new to PHP and Magento)


texts: I am using magento 1.7.0.2 , I installed package for CCAvenue from MagentoConnect, Configured it by entering MerchantId and Key and URL. But No CCAvenue payment option is displayed on my site, Only Paypal option is displayed, when I disable Paypal, No option is displayed. If any body has any idea, please share to me. Thank You.


texts: Apply coupon and get discount on next order

texts:
I have a special promotion condition and not sure Magento can do it or need other third party plugins or custom codes!

anyway here is my condition: If a customer put promo-code xxxxx and they will get xx% discount on their next order(only get this discount on next order not when promo-code puts).

Thanks!


texts: How to create a shorter route in Magento 2?

texts:
Hi so i am wondering how is it possible to create a shorter route other than the usual helloworld/index/index.

If I wanted my route to end in [magentodomain]/helloworld/index how would I be able to do that?


texts: Where does Magento store the PRODUCT_HAS_WEIGHT attribute

texts:
For some of our configured products (unfortunately), the PRODUCT_HAS_WEIGHT attribute has not been set to 1. Although, the products all have weight set (as a float), Magento still refuses to provide shipping calculation for these products.

I want to modify the PRODUCT_HAS_WEIGHT property for all products in the database. For that I want to access the MySQL database and issue a query that updates all the corresponding fields. Unfortunately, I was unsuccessful in identifying the attribute to update.

For example, to examine the weights, I would do the following:

USE database
SELECT * FROM eav_attribute where attribute_code LIKE '%weight%'
SELECT * FROM catalog_product_entity_decimal where attribute_id = 82

In a similar fashion as in line (2), product has weight is not found.

I'd kindly ask the community, to help me find the related attribute to update for each product.

I'm using Magento CE 2.1.6.


texts: Magento Mirasvit Search Cannot instantiate interface

texts:
Cannot instantiate interface
  Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\FieldProvider\FieldName\ResolverInterface


texts: Does Magento Version 1.5.0.1 requires SUPEE-6788?

texts: I am not able to find SUPEE-6788 for Magento version 1.5.0.1, does that mean we don't need for this version?


texts:
I deleted a website instance via the Magento Backend. Since then I get this error:

Recoverable Error: Argument 1 passed to Mage_Core_Model_Store::setWebsite() must be an instance of Mage_Core_Model_Website, null given

I already deleted everything in the var/cache folder and also executed this query without success:

SET FOREIGN_KEY_CHECKS=0;
UPDATE `core_store` SET store_id = 0 WHERE code='admin';
UPDATE `core_store_group` SET group_id = 0 WHERE name='Default';
UPDATE `core_website` SET website_id = 0 WHERE code='admin';
UPDATE `customer_group` SET customer_group_id = 0 WHERE customer_group_code='NOT LOGGED IN';
SET FOREIGN_KEY_CHECKS=1;

The file app/etc/use_cache.ser is not existent.

Do you have any advice how to get rid of the above mentioned error?

Thanks.


texts: How can i display selected products in the checkout tabs?

texts:
How can i display certain selected products in the checkout tabs by attribute-value?. I have some Products which have individual information for freight and i would like top display them within the fright-tab in checkout.
But just these products.

How can i manage this. I found this script:

                            $quote = Mage::helper('checkout')->getQuote();
                            foreach ($quote->getItemsCollection() as $item) {
                                // output details of an item.
                                echo $item->getName();

but i displays very products from the cart. I just want to display the product which have value in this right-attribute.


texts: How to preselect 'Simple Product' type on product grid

texts:
I always select 'Simple Product' (product type) on product grid page before I search any product to see only simple product , not group or other type

How to make the 'Simple Product' is already selected whenever I visit product grid page as default?


texts: could not locate setShippingMethod function in magento 1.9

texts:
I have enabled table rate shipping methods in magento. This is my checkout page

This is the action of update total button

action="http://{{site-url}}/checkout/cart/estimateUpdatePost/"

Now when I go to estimateUpdatePost action in cartcontroller.php file there is a line

   if (!empty($code)) {
        $this->_getQuote()->getShippingAddress()->setShippingMethod($code)/*->collectTotals()*/->save();
    }

I am lookin for setShippingMethod($code) function. I had look through the files in magento and found this function in these two files

\app\code\core\Mage\Adminhtml\Model\Sales\Order\Create.php
\app\code\core\Mage\Checkout\Model\Cart\Shipping\Api.php

But when I put die on setShippingMethod function and try to echo something then it is not shown and the page loads. It means these two setShippingMethod function is not hit and there is a function setShippingMethod somewhere else that is hit, due to which code runs. I want to locate it or if setShippingMethod function is not hit then anyone could tell me how update total button action is working.

I have made some changes to my code.
First made changes to estimateUpdatePost action

   public function estimateUpdatePostAction()
{
    $code = (string) $this->getRequest()->getParam('estimate_method');

    if (!empty($code)) {
        $this->_getQuote()->getShippingAddress()->setShippingMethod($code)/*->collectTotals()*/->save();
        die('ssssss');
    }
    $this->_goBack();
}

and then looked for setData function in magento. Found this function in following files
\app\code\core\Mage\Catalog\Model\Abstract.php
\app\code\core\Mage\Centinel\Model\StateAbstract.php
\app\code\core\Mage\Core\Model\Log\Adapter.php
\app\code\core\Mage\Core\Model\Session\Abstract\Zend.php
\app\code\core\Mage\Dataflow\Model\Convert\Container\Abstract.php
\app\code\core\Mage\Widget\Block\Interface.php

I had put a die with a message in all these functions, and when I clicked on update total button, 'ssssss' this message is shown on browser, means no setData function is running.
I am really stuck in this. Please help me in getting part of code that runs setShippingMethod($code) in estimateUpdatePostAction.


texts: How copy all Categories attributes for store view A to default store view

texts:
I would like to copy categories attributes (e.g title, search engine optimization text like url_key, contents, description etc) from a store view navigation to the default navigation.

In other words, I would like to use the categories in All Store View instead of my store view. However, I have been mistakenly editing the store view categories instead of the global ones and it's time-consuming to re-update that manually.

How to copy these:

To these:

Therefore what is a good approach to do this?

I'm not sure if doing this is correct, but I tried editing directly the table. Not sure if there are other considerations I need to put into mind when editing the table directly.

I thought to copy all records from store id 1 to store id 0 and then delete everything in store id 0 in order to reset it to use (Use Default Value)

INSERT INTO  `catalog_category_entity_text` (
  `attribute_id`,
  `store_id`,
  `entity_id`,
  `value`
)
SELECT
  `attribute_id`,
  "0",
  `entity_id`,
  `value`
FROM
  `catalog_category_entity_text_1` src
WHERE src.`store_id` = 1 AND src.value IS NOT NULL
  ON DUPLICATE KEY
  UPDATE
    `catalog_category_entity_text`.`value` = src.`value` ;


texts: Get product attribute values(name, price, status etc.) from all the stores via SQL

texts:
Trying to fetch multiple attribute values from multi-store in Magento via SQL. But it seems not to be an easy task.
Though, I can fetch Website wise attribute value via:

SELECT
        e.entity_id,
        cw.website_id,
        COALESCE(store_name.value, default_name.value) AS 'name'
FROM `catalog_product_entity` AS `e`
 CROSS JOIN `store_website` AS `cw`
 INNER JOIN `catalog_product_index_website` AS `cwd` ON cw.website_id = cwd.website_id
 INNER JOIN `store_group` AS `csg` ON csg.website_id = cw.website_id AND cw.default_group_id = csg.group_id
 INNER JOIN `store` AS `cs` ON csg.default_store_id = cs.store_id AND cs.store_id != 0
 INNER JOIN `catalog_product_website` AS `pw` ON pw.product_id = e.entity_id AND pw.website_id = cw.website_id
LEFT JOIN catalog_product_entity_varchar AS default_name ON default_name.entity_id = e.entity_id AND default_name.store_id = 0 AND default_name.attribute_id = (SELECT attribute_id FROM eav_attribute WHERE attribute_code = 'name' AND entity_type_id = 4)
LEFT JOIN catalog_product_entity_varchar AS store_name ON store_name.entity_id = e.entity_id AND store_name.store_id = `cs`.store_id AND store_name.attribute_id = (SELECT attribute_id FROM eav_attribute WHERE attribute_code = 'name' AND entity_type_id = 4)

as we have catalog_product_website table which relates between website_id & product_id. But for store<->product relationships, we don't have any special table.

Fetching a single attribute value as per store is fairly easier:

SELECT
main_tbl.entity_id,
store_tbl.store_id,
name_tbl.value AS 'name'
FROM catalog_product_entity main_tbl
LEFT JOIN catalog_product_entity_decimal price_tbl ON price_tbl.entity_id = main_tbl.entity_id AND name.attribute_id = (SELECT attribute_id FROM eav_attribute WHERE attribute_code = 'price' AND entity_type_id = 4)
LEFT JOIN catalog_product_entity_varchar name ON name.entity_id = main.entity_id AND name.attribute_id = (SELECT attribute_id FROM eav_attribute WHERE attribute_code = 'name' AND entity_type_id = 4)
INNER JOIN store cs ON cs.store_id = cpev.store_id
ORDER BY cpe.entity_id, cs.store_id ASC

But fetching values for multiple attributes at the same time via SQL is trickier (as some attribute have global scope while other having store view or website scope):

+-----------+----------+------+-------+--------+
| entity_id | store_id | name | price | status |
+-----------+----------+------+-------+--------+


texts: Automatically select shipping method in Admin Order

texts:
I have created a custom version of Order which exists only in Admin. These Orders will never use any shipping option other than Free Shipping, so the client doesn't want to click "Get shipping methods and rates" then select "Free Shipping", which is the only available option.

I have:

Enabled free shipping for Admin only.
Filtered shipping methods so only freeshipping is shown for this type of Order.

To make the selection, I tried:

replacing create/shipping/method/form.phtml with a static form.phtml that is only the container and select for free shipping, already checked.
Adding calls to order.loadShippingRates() and order.setShippingMethod('freeshipping') to fire after the ajax response from order.productGridAddSelected().

The first method throws a "Select a shipping method" error, and while the second works, it adds a second or two to each call to order.productGridAddSelected(), which isn't optimal.

Since this is a completely separate version of Order, I don't mind having it load a modified version of sales.js, but even when I have added calls to order.loadShippingRates() and order.setShippingMethod('freeshipping') in sales.js I get the "Select a shipping method" error.

I am thinking the fix needs to happen in sales.js, but I'm not sure where.

per request, the code I am using to return only freeshipping :

public function getShippingRates()
{
    if (empty($this->freeShipHolder)) {
        $groups = $this->getAddress()->getGroupedAllShippingRates();

        foreach ($groups as $carrier) {
            foreach ($carrier as $rate) {
                if ($rate['carrier'] == 'freeshipping') {
                    $this->freeShipHolder['freeshipping'][] = $rate;
                }
            }
        }
        return $this->freeShipHolder;
    }
    return $this->freeShipHolder;
}

.../Create/Shipping/Method/Form.php

That part works with no issues, but if it's informative....


texts: Including layered navigation twice on some page

texts:
We have a situation on a responsive website, in which we need to include the layered navigation twice into a page as on mobile it's hidden in one place and shown above the content.

Oviously rule of thumb is you can not call catalog/layer_view more than once on one page.


texts: How set a Shopping cart price rule that applies to all shipping countries but one and not by default?

texts:
I want to create a discount code that automatically is applied to all shipping countries except for the UK.

My default shipping country is UK but when a new user enters the site magento seems to consider the default shipping country unset until you open the checkout. The result is that if I set the price rule to "Shipping country is not UK" the discount will be applied directly until the user opens the checkout (so the minicart and shopping cart page will show the wrong price until the user reaches checkout).

A solution that works is to set a rule for every non-uk country as in hundreds of rows of "Shipping country is Canada", "Shipping country is Australia", etc. I am though not really interested in spending a couple of days entering all these.

So I'm all ears for ideas on how I can get my price rule to not apply for users that havn't set their shipping country and for users that have set it to UK but have it applied for all other countries. And to do this without manually entering hundreds of lines in the price rules.


texts: Magento 2: Sales Order report show wrong data

texts:
Orders Report gives wrong results when compared with the actual orders. For example, in Dec 22,2017, there are total 5 orders having "complete" status.

But when I view orders report after applying filters then Magento shows only 1 order having complete status.

There are lots of such examples, I only mentioned one. I also noticed that Magento is not showing any order report after Dec, 2017 (There are many orders placed in 2018.)

Could you guys please help me to fix this?


texts:
I added these custom js and css file:

skin/frontend/base/default/black/NewsletterPopup/js/main.js
skin/frontend/base/default/black/NewsletterPopup/css/main.js

Then I included them via my modules layout file

  app/design/frontend/base/default/layout/black/newsletter_popup.phtml

<?xml version="1.0"?>
<layout version="0.1.0">
    <default>
        <reference name="head">
            <action method="addJs">
                <script>black/NewsletterPopup/js/main.js</script>
            </action>
            <action method="addCss">
                <stylesheet>black/NewsletterPopup/css/main.css</stylesheet>
            </action>
        </reference>
    </default>
<!-- ... -->

But a network analysis showed that the files could not be found and if I enter the link to the file directly into the URL then the "404 Sorry page not found" page shows up.

What am I doing wrong?


texts:
Our checkout seems to be broken and more people seem to have the problem with magento 1.8. It simply doesn't do anything after you press the continue button in step 4.
We run PHP 5.4.19 and have tried it in chromium v28, firefox v22, safari v5.1.

There is no errors in the logs and it's the same in the default theme.


texts: Design of popup window when clicked on account (rwd theme)

texts: I am trying to customize the rwd theme. When you click on the account button above on the right side of the header, a popup window appears. My question is which file contains the css rules for the popup window. I searched but I didn't find the right file...


texts: Found a potential bottle neck when reindexing prices in 2.3.2

texts:
I have a total of 7193 products in the catalog. 6704 simple and 489 configurable.

When reindexing, Magento iterates trough all price indexers and process them. I added some debug messages and found out that the bundle and group products takes very long to process. However, there are no bundle or grouped products in my catalog! I added a simple condition to skip the bundle and grouped types and the time to reindex prices went from 2:06 minutes to 14 seconds.

This is the file that iterates the indexers:
vendor/magento/module-catalog/Model/Indexer/Product/Price/Action/Full.php

I'm thinking of building a plugin for that skip indexers based on product types not used... But I need to investigate a bit more. Anyone else noticed this problem?


texts: Two level cache and lifetime issue (for specialist!!!)

texts:
I've an issue  with the two level cache, here the situation:
- fast cache : memcache
- slow : database but with store_data false (i only keep tags)

When i try to save in cache custom data with lifetime using:

Mage::app()->getCache()->save(serialize($value),$cacheId,array("custom_tag"), 180);

The value is saved in memcached but the lifetime is not set (so i have an infinity expiration time, the only solution is to flush the cache.

I search into Magento code and i think the issue is in the TwoLevels.php file (in lib/Zend/Cache/Backend/TwoLevels.php), indeed, when the value is save we have:

$fastLifetime = $this->_getFastLifetime($lifetime, $priority);
$boolFast = $this->_fastBackend->save($preparedData, $id, array(), $fastLifetime);
$boolSlow = $this->_slowBackend->save($preparedData, $id, $tags, $lifetime);

We can see that the lifetime for the FastBackend (memcache in my case) is modified by the _getFastLifetime function and here is this function:

private function _getFastLifetime($lifetime, $priority, $maxLifetime = null)
{
    if ($lifetime <= 0) {
        // if no lifetime, we have an infinite lifetime
        // we need to use arbitrary lifetimes
        $fastLifetime = (int) (2592000 / (11 - $priority));
    } else {
        // prevent computed infinite lifetime (0) by ceil
        $fastLifetime = (int) ceil($lifetime / (11 - $priority));
    }

    if ($maxLifetime >= 0 && $fastLifetime > $maxLifetime) {
        return $maxLifetime;
    }

    return $fastLifetime;
}

The issue in this function is that even if we don't passed $maxlifeTime argument, so null is used  the condition $maxLifetime >= 0 is still true so the return value become $maxlifetime ( so null) instead of $lifetime.

Can anyone confirm that this is a bug?


texts: Slow performance of: Mage_Eav_Model_Entity_Abstract::getSortedAttributes

texts:
Hi we are seeing some slow performance in "Mage_Eav_Model_Entity_Abstract::getSortedAttributes"

I was reading this (from 2 years ago and Mage 1.6). Would this still apply?

http://blog.nexcess.net/2012/04/16/simple-magento-sort-optimization-patch/


texts: Customer's Phone Number Collection w/PayPal

texts:
I was wondering if anyone has come up with a way to collect the telephone number of customers that are checking out with PayPal.

If my customer checks out on my website using their credit card number through Authorize.net, they provide their shipping information & contact information to the MagentoCE platform...

However when they use PayPal Express, they also provide the shipping information & contact information to PayPal, however PAYPAL does NOT send back the PHONE Number that the customer enters even though it is a required field. I have phoned PayPal on this, and multiple agents report that the system collects the number, but does not send it to the merchants for privacy reasons.

Unfortunately, we require the phone number of our clients to arrange shipping & other matters, as our products are very large...

Any ideas as to how I would force customers to provide this information to us as well?


texts: Elasticsearch is not able to search "5600" when product name has "TW5600"

texts:
My Product name: Epson EH TW5600 Full HD Home Cinema Projector | Lens Shift | 2500 Lumens | Bluetooth Audio

Search Term: "5600" or "Epson 5600"

In the above condition, my elasticsearch is not able to search "5600". It returns empty products.

I was using solr in my Magento 1 and it was working fine.

Any suggestions on this?


texts: How to do create a form ui component select box with a source to fill select box

texts:
I am trying to find out how I can create a select box in magento component ui form and point it to some where I can fill in the select list.

Something like this I thought would work but it does not

<field name="formats">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="dataType" xsi:type="string">text</item>
                <item name="disabled" xsi:type="boolean">false</item>
                <item name="label" xsi:type="string" translate="true">formats</item>
                <item name="formElement" xsi:type="string">select</item>
                <item name="enabled" xsi:type="boolean">false</item>
                <item name="source" xsi:type="string">Magento\Catalog\Model\Product\AttributeSet\Options</item>
                <item name="dataScope" xsi:type="string">formats</item>
            </item>
        </argument>
    </field>

Thanks


texts:
I am editing the file \app\design\frontend\base\default\template\catalog\product\list\toolbar.phtml through my own module. I want to specify the available categories on the current list.

Example: I search for "shirt" and the products that contains "shirt" is in 2 categories: summer and winter.

The idea is that the user can filter by (not order by) one of the two categories available.
I searched this function:

<?php foreach ($this->getAvailableLimit() as  $_key=>$_limit): ?>

I found out that it only works with specific attributes of product and only for "order by", but what about the categories? and if I want to "filter by"?

Is that possible? Any ideas?

Thanks!

I response to myself:

I do it!

On the one hand I copied the file toolbar.php to override it (and add my personalized functions) and secondly the List.php file to edit the collection list and add my category_id filter. Finally I edited my toolbar.phtml file to add the dropdown list with available categories and get the categoryId param to keep selected the category in the dropdown.


texts: How to set the category for menu programmatically Magento 2

texts:
How can I set the root category for menu programmatically on Magento 2?
I want to create a menu with a given category ID, so that given category will load on the menu.


texts: Magento 1 : How to add Home Page in Top Menu?

texts:
The site URL is http://juicecore.com/. I could really use some guidance on getting that top navigation link for “Home” to point to the same CMS home page as the main URL and logo do.

The top menu was created by creating categories and assigning static blocks to them.
The static block assigned to the top nav Home link is coded as

Home

I also tried using “/” and a full path url, no dice.
The logo points to the index page which corresponds to the CMS page assigned for home page content.
System/Configuration/General/Web/Default Pages/CMS Home Page is set to use the correct page.
I tried editing this line is topnav.phtml a few different ways, no dice:

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

After many Google and forum searches, I’m at a loss as to what to try next. I just need that home link to point to the same CMS content page as the logo and main url http://juicecore.com/ do. Any thoughts would be greatly appreciated.


texts:
Magento admin menu redirect to 404 page

<menu>
            <overlay module="adminhtml">
                <title>Popup</title>
                <sort_order>71</sort_order>
                <children>
                    <items module="adminhtml">
                        <title>Manage Items</title>
                        <sort_order>1</sort_order>
                        <action>package_overlay/adminhtml_overlay</action>
                    </items>
                </children>
            </overlay>
        </menu>


texts:
How to get attribute group name by attribute group id
<?php
$attribute_group_id = 2; /// this is group id

echo likeGetnameforthis($attribute_group_id);

?>


texts: MAGENTO 2: How to update meta tag for category page when filter selected?

texts:
I want to change the Meta Tag to NOINDEX, NOFOLLOW I am trying with setting an observer, but m having very hard time to find exact event.

My events.xml is

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

</config>

The observer file is :

<?php

namespace PinkBlue\SeoUrl\Observer;

use Magento\Framework\Event\ObserverInterface;

class ChangeMetaTags implements ObserverInterface {

    public function execute(\Magento\Framework\Event\Observer $observer){
         rm_state()->controllerSet($observer['controller_action']);

        if($observer->getEvent()->getAction()->getFullActionName() == 'catalog_category_view'){
            $uri = $observer->getEvent()->getAction()->getRequest()->getRequestUri();
            if(stristr($uri,"?"))// looking for a ?
            {
                $layout       = $observer->getEvent()->getLayout();
                $product_info = $layout->getBlock('head');
                $layout->getUpdate()->addUpdate('<reference name="head"><action method="setRobots"><value>NOINDEX,NOFOLLOW</value></action></reference>');
                $layout->generateXml();
            }
        }

}

**Answer : when we want to do it only for category filter is applied. It worked **

 public function execute(\Magento\Framework\Event\Observer $observer)
    {

        $full_action_name = $observer->getFullActionName();

        $layout = $observer->getEvent()->getLayout();
        if($full_action_name == 'catalog_category_view'){
            $uri = $_SERVER['REQUEST_URI'];

            if(stristr($uri,"?"))
            {
                $this->_pageConfig->setRobots('NOINDEX,NOFOLLOW');
            }
            //print_r($layout->getBlock('head')->getRobots());
        }

    }


texts:
i have a configurable product with 3 choises.

choose meterial (dropdown)
choose chain (dropdown)
add your name here (custom option - text field)

now i want the "add your name here" to be first choise.

what is my options?


texts: Magento 2: How to add a custom JS to frontend module?

texts:
I'm building a module and I need to load Javascript that must be generated in my module (NO theme) to the shop frontend.

Then, when a user enters on the web, the module has to generate js and inject to the shop frontend.

The js has variables that I have in the database,  then I need to join it with a Block and PHTML to create it.

How can I do it?


texts:
I added new order status by System -> Order Statuses

My doubt is need to add that status name in app/code/core/Mage/Sales/Model/Order.php this file.?

Currently that file has this code

    const STATE_NEW             = 'new';
    const STATE_PENDING_PAYMENT = 'pending_payment';
    const STATE_PROCESSING      = 'processing';
    const STATE_COMPLETE        = 'complete';
    const STATE_CLOSED          = 'closed';
    const STATE_CANCELED        = 'canceled';
    const STATE_HOLDED          = 'holded';

Need to add my status name here.?

If yes,how to do that without write core file.?

Anyone can tell?


texts:
I have a store view:

 - Default
 - First store
 - Second store

The second store has a problem with the categories

First store - its URL looks like this: firststore.com/category-name/

when i go to the category Second store - its URL looks like this: secondstore.com/directory/category/view/s/category-name/id/111/

URL modules that should work with categories do not work correctly on the second store, tell me how to convert URLs to secondstore.com/category-name/


texts: "An error occurred while sending the order email."

texts:
I hope someone can help me. I'm using Magento 1.9.1.0. Since yesterday my customers get no order confirmation by email. In the log file I get the following error message,

  exception 'Zend_Mail_Exception' with message 'Subject set twice' in /is/htdocs/wp10917496_PXDL7M6OYT/www/magento/lib/Zend/Mail.php:933
  Stack trace:

  0 /is/htdocs/wp10917496_PXDL7M6OYT/www/magento/app/code/community/Mage/Smtp/Model/Email/Template.php(40): Zend_Mail->setSubject('Laseria's Gesch...')

  1 /is/htdocs/wp10917496_PXDL7M6OYT/www/magento/app/code/core/Mage/Core/Model/Email/Template.php(508): Mage_Smtp_Model_Email_Template->send(Array, Array, Array)

  2 /is/htdocs/wp10917496_PXDL7M6OYT/www/magento/app/code/core/Mage/Core/Model/Email/Template/Mailer.php(84): Mage_Core_Model_Email_Template->sendTransactional('11', 'general', Array, Array, Array, '1')

  3 /is/htdocs/wp10917496_PXDL7M6OYT/www/magento/app/code/core/Mage/Sales/Model/Order.php(1354): Mage_Core_Model_Email_Template_Mailer->send()

  4 /is/htdocs/wp10917496_PXDL7M6OYT/www/magento/app/code/core/Mage/Sales/Model/Order.php(1369): Mage_Sales_Model_Order->queueNewOrderEmail(true)

  5 /is/htdocs/wp10917496_PXDL7M6OYT/www/magento/app/code/core/Mage/Adminhtml/controllers/Sales/OrderController.php(139): Mage_Sales_Model_Order->sendNewOrderEmail()

  6 /is/htdocs/wp10917496_PXDL7M6OYT/www/magento/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Adminhtml_Sales_OrderController->emailAction()

  7 /is/htdocs/wp10917496_PXDL7M6OYT/www/magento/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('email')

  8 /is/htdocs/wp10917496_PXDL7M6OYT/www/magento/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))

  9 /is/htdocs/wp10917496_PXDL7M6OYT/www/magento/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()

  10 /is/htdocs/wp10917496_PXDL7M6OYT/www/magento/app/Mage.php(684): Mage_Core_Model_App->run(Array)

  11 /is/htdocs/wp10917496_PXDL7M6OYT/www/magento/index.php(87): Mage::run('', 'store')

  12 {main}

Thanks in advance


texts: How to solve the problem of PayPal gateway has rejected request?

texts:
I am using Magento 1.9 and I have set up PayPal express checkout as payment method but I am getting an error like this:

  PayPal gateway has rejected request. Callback URL is wrong type; you
  must use the HTTPS (#11813: Callback URL is wrong type).

So, can any one help me in this problem ?


texts: How can I set up the same tax rate for multiple countries without making an entry in the tax_rates.csv file for every country? Is there an easy way to do it?


texts: Adding New Products to the inventory from Wholesaler CSV

texts:
hoping for some help here.
I have taken over an ecomm store ( Magento ver. 1.9.1.0) and it has an import profile which does the following

only marks my existing products in stock or out of stock based on whether they are present in the import CSV file or not
if not present, then the item is marked out of stock
if present (or comes back in the next feed), then the item is marked in stock

Problem is the item has to be in my inventory for this CSV to work. I have to add each product manually.
If an item is not in my inventory & the vendor's CSV file has a NEW item then it is not added on my store.
Due to this i have very few items on my store, as compared to what is available in the back end?
How can i fix this? i.e. if a NEW product is available I want to add it in my inventory.
And the follow up question would be how can I add rules around pricing- since I new do add a markup on the prices in the CSV.
Can this all be done via admin console or do I need to write custom code?
Thanks heeps,


texts: How to remove or solve Fatal error: Cannot redeclare class in magento

texts:
I m using two theme...one is for desktop and one is for mobile...
In both file one class name is same in his lib
the class name is mobile_detect ...so when i m using both theme i found one
error....Fatal error: Cannot redeclare class Mobile_Detect in E:\xampp\htdocs\gala_theme_magento-9\lib\em\Mobile_Detect.php on line 34...

SO i need to know that without renaming class name how can i resolved this issue...


texts:
I am struggling with an issue since yesterday, i really need some help from someone who is more experienced with magento.  I have a problem with the Widgets/static blocks. Whenever i create a static block, and attach it to the widget, it wont show up in my store. I triple checked the settings, i also followed the provided guide that came with my theme, but still no success.

This is what i do:

First i created a static block with some lorem text.
Then i created a widget and attached the static block with the lorem text.
Then i select Display on: all products
Products: specific product page
Then i the select the specific page i want the static block to show on
Then i select the block reference (Product view secondary column container 1, my theme guide told me to use this)

But it's still not showing up:(

I already tried flushing the cache
i double checked my "Design Package" setting of the widget which is ultimo/default
Deleted cookies
Tried setting Anchor to Yes/NO

I'm using this theme: http://themeforest.net/item/ultimo-fluid-responsive-magento-theme/3231798

I have absolutely no idea what i'm doing wrong, can somebody please help me?

Thanks in advance:


texts: Create custom import history entry in magento 2

texts:
I'm using a custom import products code and i want to add a new import history entry when i use my custom import
and create an error report csv file while imported file is invalid.
Any help please !!
this is my custom import code:
public function importProduct($rowData){

$csvModel = $this->csvFactory->create(['destination' => self::PATH_FILENAME]);
$csvModel->writeRow($rowData);

$importModel = $this->importModelFactory->create();

$importModel->setData([
            "entity"=>"catalog_product",
            "behavior"=>"add_update",
            "validation_strategy"=>"validation-stop-on-errors",
            "allowed_error_count"=>"10",
            "_import_field_separator"=>";",
            "_import_multiple_value_separator"=>","
        ]);

$sourceModel = \Magento\ImportExport\Model\Import\Adapter::findAdapterFor(
                self::PATH_FILENAME,
                $this->objectManager->create(\Magento\Framework\Filesystem::class)
                                    ->getDirectoryWrite(\Magento\Framework\App\Filesystem\DirectoryList::ROOT),
                $importModel->getData(\Magento\ImportExport\Model\Import::FIELD_FIELD_SEPARATOR)
        );

$isValid = $importModel->validateSource($sourceModel);
if ($importModel->getProcessedRowsCount() === 0 ||
    !$isValid ||
    $importModel->getErrorAggregator()->getErrorsCount()
) {
    var_dump($importModel->getErrorAggregator()->getAllErrors());
    exit;
}

try {
    $importModel->importSource();
    echo "sucess import";
} catch (\Exception $e) {
    throw new \Exception($e->getMessage());
}}


texts: Apply Magento Coupon in Ajax Without Redirecting to Cart Page

texts:
I have coupon code on sidebar on my product categories list, cart and checkout page. Whenever I'm trying to add coupon code while being on the product or category list page or checkout page, it is taking me to the cart page. Is there any way I can make it apply on the same page  without redirecting or reloading with the help of ajax?

<?php echo $this->getMessagesBlock()->toHtml(); ?>

<form id="discount-coupon-form" action="<?php echo $this->getUrl('checkout/cart/coupon') ?>" name="discountcode-form" method="post">

<?php echo $this->__('Discount Codes') ?>

            <input type="hidden" name="remove" id="remove-coupone" value="0" />

                <input class=" form-control" type="text" placeholder="Enter Coupon Code" id="coupon_code" name="coupon_code" value="<?php echo $this->escapeHtml($this->getCouponCode()) ?>" />

                   <?php $block = $this->getLayout()->createBlock('checkout/onepage_link'); ?>   <?php if ($block->isPossibleOnepageCheckout()):?>       <?php if ($block->isDisabled()):?>               <input type="submit" title="Minimum order should be Rs.300 or above" value="<?php echo $this->__('REEDEM COUPON') ?>" class="btn-danger btn-checkoutno-checkout" disabled="disabled" />                    <?php else: ?>                   <input type="submit" title="Minimum order should be Rs.300 or above" value="<?php echo $this->__('REEDEM COUPON') ?>" class="btn-danger"  />
                   <?php endif?>    <?php endif?>

 <?php if(strlen($this->getCouponCode())): ?>
                        <button type="button" title="<?php echo $this->__('Cancel') ?>" class="button2 cancel-coupon" onclick="discountForm.submit(true)" value="<?php echo $this->__('Cancel') ?>"><?php echo $this->__('Cancel') ?>
                        </button>
                    <?php endif;?>

</form>


texts: Magento 1.9 - Product page shows blank page

texts:
Some product detail pages works fine but some product detail page shows blank.System log file shows below error

  2018-04-30T12:08:08+00:00 ERR (3): Warning: include(/home/occasion/public_html/includes/src/Crypt_Hash.php): failed to open stream: No such file or directory  in /home/occasion/public_html/includes/src/Varien_Autoload.php on line 94

How to resolve this issue?


texts: Magento2 Hide Custom Tab based on Condition

texts:
I have created custom tab in Magento2 in my Custom module. The code used to make tab was using xml like -

        <referenceBlock name="product.info.details">
            <block class="Vendor\Faq\Block\Product\View\Details\Faqtab" name="vendorFaqtab" template="Vendor_Faq::product/view/details/faqtab.phtml" group="detailed_info"/>
        </referenceBlock>

I want to be able to show hide the tab based on a check in admin. Like show in frontend yes/no.


texts: Magento 2: how to get swatch options in custom product list on detail page?

texts: I added my custom product list in detail page, the collection is properly displaying but now I want to display swatches in that list. is there any way to make it possible?


texts: Magento2 cannot add stock data via StockItemInterface

texts:
I am writing a module that loops over a result-set and creates products. Creating products works fine, but some how I am not able to save stock qty.

This is my code: http://pastebin.com/7Drn8Jht

Here I assign my stockItem to the product object

$productExtension = $this->productExtensionFactory->create();
$this->stockItem->setItemId(1);
$this->stockItem->setQty(100);
$this->stockItem->setUseConfigManageStock(true);
$this->stockItem->setIsInStock(true);
$this->stockItem->setIsQtyDecimal(false);
$this->stockItem->setUseConfigMinQty(true);
$this->stockItem->setMinQty(0);
$this->stockItem->setUseConfigMinSaleQty(0);
$this->stockItem->setMinSaleQty(0);
$product->setExtensionAttributes($productExtension->setStockItem($this->stockItem));

$product->setStockData(['qty' => 100, 'is_in_stock' => 1]);
$product->setQuantityAndStockStatus(['qty' => 100, 'is_in_stock' => 1]);

But for some reason this is not working. If I look at my catalog the stock qty is for each product empty. What am I doing wrong?


texts: Magento 2 admin taking too much to open product edit page for large number of assciated products

texts:
Magento 2 admin product edit page taking too much time to load product edit page for a large number of the associated product(around 1500) for bundle products.

Till now, I have tried to set 'opened' =>false in Ui component. But this doesn't solve the problem the problem of time it took to load the page. How can I do this?

Any help would be appreciated.


texts:
I want format from string to date. How can i do?

public function checkTimeCourse(){

    $modelCoure = Mage::getModel('course/courses')->getCollection();
    $modelCoure->getSelect();
    $toDay = date('Y-m-d');echo $toDay; //2020-05-19
    foreach($modelCoure as $item){
        $dateTo = date($item->getDateTo()); // select from database string(2020-05-25)
        $checkDay = $toDay - $dateTo;
        var_dump($dateTo);
    }exit();

Help me please!


texts: Remove my custom attribute code and only show the value in the checkout address summary

texts:
Is there a way to remove my custom attribute code and only show the value?

I created a custom address attribute "special_instructions" and when I add an address in my account section everything works fine.. but when I add an address in the checkout the address summary shows my attribute code and the value.

What can I do?


texts: Creating a new table in magento using the installer issue

texts:
I have created a module, but now i need to create a table in db.
this is the content of the Mynamespace/Mymodule/sql/mynamespace_mymodule_setup/mysql4-install-0.1.0.php:

<?php
/* @var $installer Mage_Core_Model_Resource_Setup */
$installer = $this;
echo 1; exit();
$installer->startSetup();
$table = $installer->getConnection()
    ->newTable($installer->getTable('mynamespace_mymodule/mytablename'))
    ->addColumn('id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
        'identity'  => true,
        'unsigned'  => true,
        'nullable'  => false,
        'primary'   => true,
        ), 'Id')
    ->addColumn('check', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
        'nullable'  => false,
        ), 'Check')
$installer->getConnection()->createTable($table);

$installer->endSetup();

this is the content of the config.xml file:

<config>
    <modules>
        <Mynamespace_Mymodule>
            <version>0.1.0</version>
        </Mynamespace_Mymodule>
    </modules>
    <global>
    <models>
            <mynamespace_mymodule>
                <class>Mynamespace_Mymodule_Model</class>
                <resourceModel>mynamespace_mymodule_mysql4</resourceModel>
            </mynamespace_mymodule>
            <mynamespace_mymodule_mysql4>
                <class>Mynamespace_Mymodule_Model_Mysql4</class>
                <entities>
                    <mytablename>

mynamespace_mymodule_mytablename

                    </mytablename>
                </entities>
            </mynamespace_mymodule_mysql4>
        </models>
        <resources>
            <mynamespace_mymodule_setup>
                <setup>
                    <module>Mynamespace_Mymodule</module>
                </setup>
                <connection>
                    <use>core_setup</use>
                </connection>
            </mynamespace_mymodule_setup>
            <mynamespace_mymodule_write>
                <connection>
                    <use>core_write</use>
                </connection>
            </mynamespace_mymodule_write>
            <mynamespace_mymodule_read>
                <connection>
                    <use>core_read</use>
                </connection>
            </mynamespace_mymodule_read>
        </resources>
    </global>

As you see I put an exit in after $installer. It never goes there. Something is wrong with my xml file. Can you help me with this ? thx


texts: Remove "product information, reviews, tags" block from product page

texts:
I am trying to remove a certain block from my product page in Magento, but can't seem to find where I should delete it. I think it's somewhere in the XML files, but since I'm not that good of a web-developer, I figured it's stupid to just try to delete some files.

In the Magento admin I already disabled the 'tags' function (admin -> system -> configuration -> advanced -> disable Mage_Tag), but I can't find where to delete the entire block.

The block circled in red in the picture is the block I'm trying to delete. So also 'productomschrijving' and 'extra informatie'.


texts: Magento Custom Module for add-to-cart Not Working - Observer Triggered

texts:
Created module like No other products add to cart if restricted product available in cart and vice versa.

My Module :

  app/etc/modules/Brst_Test.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Brst_Test>
            <active>true</active>
            <codePool>community</codePool>
        </Brst_Test>
    </modules>
</config>

This is my observer file

  app/code/community/Brst/Test/Model/Observer.php

<?php
ini_set('display_errors', '1');

// Mage::log('fine dude', null, 'logfile.log');
class Brst_Test_Model_Observer
{
    //Put any event as per your requirement
    public function logCartAdd($observer) {
        // Mage::log('good dude', null, 'logfile.log');

        $product = Mage::getModel('catalog/product')
                        ->load(Mage::app()->getRequest()->getParam('product', 0));
        $cart_qty = (int) Mage::getModel('checkout/cart')->getQuote()->getItemsQty();

        if ($product->getId()==31588 && $cart_qty > 0) {
            Mage::throwException("You can not add This special Product, empty cart before add it");
        }
        $quote = Mage::getModel('checkout/cart')->getQuote();
        foreach ($quote->getAllItems() as $item) {
            $productId = $item->getProductId();
            if($productId==31588){
                Mage::throwException("Cart has Special Product you can not add another");
            }
        }
    }
}
?>

  app/code/community/Brst/Test/etc/config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Brst_Test>
            <version>1.0.0</version>
        </Brst_Test>
    </modules>
    <global>
        <models>
             <brst_test>
                <class>Brst_Test_Model</class>
             </brst_test>
        </models>
    </global>
    <frontend>
            <events>
                <checkout_cart_product_add_after>
                    <observers>
                        <Brst_Test_Model_Observer>
                            <type>singleton</type>
                            <class>Brst_Test_Model_Observer</class>
                            <method>logCartAdd</method>
                        </Brst_Test_Model_Observer>
                    </observers>
                </checkout_cart_product_add_after>
            </events>
    </frontend>
</config>

Not working, how to solve the error?


texts:
I've been looking around at different ecommerce websites and I noticed that a lot of them have the following meta information:

PART 1

Magento only has the option to set pages as INDEX, FOLLOW, how would I add INDEX, ARCHIVE, FOLLOW as part of the options?

PART 2

How can I add a seperate META for GOOGLEBOT or other specific bots to try and increase indexing?


texts: magmi - not able to import/assign product to there categories

texts:
I am trying to import products via magmi all the other attributes are imported , but I am not able to assign those products to there categories. (I have already enabled On the fly category creator/importer). but still I am not able to figure out why the products are not getting assigned to the categories.

here is the snippet of my csv file

  store,attribute_set,type,tax_class_id,sku,name,description,weight,status,visibility,price,special_price,special_from_date,special_to_date,use_config_manage_stock,custom_range,custom_catalogue,item_type,color,color_specific,custom_lead_time_message,news_from_date,news_to_date,giftboxed,discontinued,discontinued_text,release_date,size_text,related_keyword,category_ids,media_gallery,image,small_image,thumbnail,options_container,bundle_skus,sku_type,weight_type,price_type,price_type,product_attr_brand,product_attr_range,product_attr_pattern,product_attr_group,product_attr_group_item,product_attr_size,product_attr_imp,product_attr_met,product_attr_cap_imp,product_attr_cap_met,product_attr_pres_met,product_attr_pres_imp,product_attr_warranty,product_attr_carton_pcs,product_attr_carton_vol_metric,product_attr_carton_vol_imp,product_attr_carton_wt_metric,product_attr_carton_wt_imp,product_attr_item_wt_metric,product_attr_item_wt_imp,product_attr_barcode_code128,product_attr_barcode_ean13,product_attr_carton_dim_metric,product_attr_carton_dim_imp,product_attr_size_range,product_attr_cap_range,product_attr_colour,product_attr_material,product_attr_shape,custom_warranty_time,websites,new
  Default,Default,simple,2,11010043ysys,"Simplicity: Sake/Condiment Cup 4.5cl (1.6oz) - Simplicity White","Sake/Condiment Cup",0,1,"Catalog, Search",9.99,,,,1,,,,White,White,No,,,0,0,,,,,,,,,,container1,,,,"Use config","Use config","Steelite Performance",Simplicity,"Simplicity White (1101)",Accessories,"Sake/Condiment Cup","4.5cl (1.6oz)",,,,,,,Y,12,"0.0173 cu. m","0.61 cu. ft","1.15 kg","2.54 lb","0.059 kg","0.13 lb",0105018461394748,5018461394748,"408 x 319 x 133 mm","16.1 x 12.6 x 5.2 inches",,,White,"Alumina Vitrified",Round,,"base,europe02,americas01",0
  Default,Default,simple,2,11010114ysys,"Simplicity: Rimmed Soup Plate - 23cm (9"") 44cl (15.5oz) - Simplicity White","Rimmed Soup Plate",0,1,"Catalog, Search",9.99,,,,1,,,,White,White,No,,,0,0,,,,,128,,,,,container1,,,,"Use config","Use config","Steelite Performance",Simplicity,"Simplicity White (1101)",Bowls,"Rimmed Soup Plate","23cm (9"") 44cl (15.5oz)","9""","23 cm","15.5 oz","44 cl",,,Y,24,"0.0173 cu. m","0.61 cu. ft","14.24 kg","31.39 lb","0.581 kg","1.28 lb",0105018461000144,5018461000144,"264 x 244 x 268 mm","10.4 x 9.6 x 10.6 inches","7.1"" to 9""",,White,"Alumina Vitrified",Round,,"base,europe02,americas01",0
  Default,Default,simple,2,11010115ysys,"Simplicity: Soup Cup Lugged - 28.5cl (10oz) - Simplicity White","Soup Cup Lugged",0,1,"Catalog, Search",9.99,,,,1,,Tableware,"Alumina Vitrified",White,White,No,,,0,0,,,,,"189,1386",,,,,container1,,,,"Use config","Use config","Steelite Performance",Simplicity,"Simplicity White (1101)",Bowls,"Soup Cup Lugged","28.5cl (10oz)","5.63""","14.4 cm","10 oz","28.5 cl",,,Y,36,"0.0519 cu. m","1.83 cu. ft","12.4 kg","27.34 lb","0.326 kg","0.72 lb",0105018461000151,5018461000151,"525 x 385 x 257 mm","20.7 x 15.2 x 10.1 inches","7"" or under","5.1oz to 11oz",White,"Alumina Vitrified",Round,,"base,europe02,americas01",0

not sure what I am doing wrong here ? does the data inputs I have passed to category_ids cell is in correct format ?

Thanks in advance.


texts: Getting error while refreshing "adminhtml/sales_order_totals" block through AJAX

texts:
I am developing custom module, in which i'm adding custom block sales->order edit page with field price that update total paid price (Order Totals) block. But while refreshing adminhtml/sales_order_totals block, i got an error

Fatal error: Call to a member function getOrder() on a non-object \app\code\core\Mage\Sales\Block\Order\Totals.php on line 67

After clicking to "Add button", It call saveAction() controller

public function saveAction()
{
    $modelOrder = Mage::getModel('sales/order')->load(100015)->setGrandTotal(300)->save();
    return $this->_forward('successajax');

}

and $this->_forward('successajax'); call to below controller

public function successajaxAction()
{
    $this->loadLayout();
    $this->getResponse()->setBody(
        Mage::app()->getLayout()->createBlock('adminhtml/sales_order_totals')->setTemplate('sales/order/totals.phtml')->toHtml()
    );
}

On ajax response, We replace Order Totals block will showing me bellow error.

Please help me to resolve this error.


texts:
We've recently upgraded a site from CE 1.5.0.1 to CE 1.7.0.2, and now all product pages just resolve to a 404 page. This applies for direct links, with the product-url.html after the domain, and also full canonical links. It also applies when we try to access the product by using the full /catalog/product/view/id/1000 URL.

There is, and I imagine its related, an issue with indexing on the site. There are 72k products so indexing is slow at best, but I've still been unable to get all indexes to complete without errors, and currently the Catalog URL Rewrites index is stuck on Processing.

We've tried truncating the core_url_rewrites table, and obviously reindexing everything. We've also created simple plain test products which also don't work.

.htaccess file matches the live, working site, is there anything else we may have missed?

I've now discovered that the product object is still available for me on the 404 page - weird huh? I can access all of the product data using Mage::registry('current_product');, this led me to look at the product view controller, and I discovered that commenting out Mage::dispatchEvent('catalog_controller_product_view', array('product' => $product)); showed the product page.

So I can only think that something is hooked onto this event and causing the page to die - obviously leaving this line commented out isn't a solution as its causing other issues with the product, but should point us in the right direction?

Any ideas would be greatly appreciated, there are no custom modules that listen for this event.

Thanks.


texts: Magento 2 add custom block in custom layout

texts:
Our designer works in our own custom layout, located in:

/app/design/frontend/Vendor/Namespace

There we modify the default layout Magento_LayeredNavigation::view.phtml

Now we want to add a custom block to this file:

$block->something();

inside the structure of filter.phtml

We wrote a custom module (app/code/vendor/namespace) with a block and we add this information in:

app/code/vendor/namespace/view/frontend/layout/catalog_category_layered.xml
app/code/vendor/namespace/view/frontend/layout/catalog_category_view.xml

Now our question:

Is it correct that we add this new block in the custom design structure of view.phtml? - Or do we have to move the whole file (view.phtml) into
the custom module ( which is bad for the designers .. cause the layout infos
are mixed in several modules then! )


texts: My second website is displaying the default theme instead of my custom theme

texts:
I am setting up a second website on my magento system.
Eventually this will have its own domain name and be hosted in my main magento installation.

To allow me some time to finalise the domain name and test some themes I would like to set up the new website under my "dev" magento as a SECOND WEBISTE. (ie run multiple websites with a common backend)

I have been reading various websites to get information and I have done the following.
1. Installed a new theme "diyalarms" (copied the current theme from my current website with a new name of "diyalarms" from origial theme files I purchased)

Created a new Website, Store, View with the code "diyalarms"
Under General/Web I - 1. Changed scope to diyalarms, 2. changed unsecure & secure urls to diyalarms.ozfitsports.com.au and unchecked use defaults.
In Cpanel created a new subdomain diyalarms.ozfitsports.com.au and pointed to /dev
Added the following to index.php

switch($_SERVER['HTTP_HOST']) {

    case 'diyalarms.ozfitsports.com.au':

        $mageRunCode = 'diyalarms';

        $mageRunType = 'website';

    break;
}

Under System/design created a Design for View "diyalarms" by selecting theme from dropdown box.

Typing in diyalarms.ozfitsports.com.au open with what appears to be the "default" magento theme, not the theme "diyalarms" which should look the same as "ozfitsports.com.au" which is where I copied the theme from.

I have spent 6hrs searching the web and can't seem to find anything that I havnet already done.

I woudl really appreciate any suggestions as to what I have done wrong or have missed.
I am using magento ce 1.6.1

Thanks


texts: Attributes error on importing Magento 2 products


texts:
how can I make this word "item(s)" translatable in the below code in line 20

                <?php
                $its = $giftbox->getItemCollection();
                $numberitems = 0;
                foreach ($its as $it) {
                    $itemId = $it->getItemId();
                    $item = Mage::getModel('sales/quote_item')->load($itemId);
                    $product = Mage::getModel('catalog/product')->load($item->getProductId());
                    $qty = $it->getQty();
                    $numberitems += $qty;
                    ?>

                    <?php
                    //$idProduct=Mage::getSingleton('core/session')->getIdProduct();
                    $classname = 'p' . $item->getProductId();
                    ?>
                    <li id="<?php echo $classname; ?>"><a href='<?php echo $product->getProductUrl(); ?>' ><?php echo $item->getName(); ?> <?php
                        if ($item->getProductId()) {
                            echo ' - ' . intval($qty) . ' item(s)';
                        }
                        ?>

                    <?php
                }
                if (Mage::getStoreConfig('giftwrap/calculation/amount_on_number_items')) {
                    $giftwrapAmount = floatval($numberitems) * (floatval($style->getPrice()) + floatval($giftcard->getPrice()));
                } else {
                    $giftwrapAmount = floatval($style->getPrice()) + floatval($giftcard->getPrice());
                }
                ?>


texts: What layout xml is used for email templates?

texts:
If I create a email template in System > Transactions Email what xml layout is used?

What is the block type here?


texts: duplicate all products from one store to another store with different stock values

texts:
I am new in magento I want to duplicate all products and categories from one store to another store e.g

store 1

category 1
 -> product 1

Store 2

category 1 (duplicate)
 -> product 1 (duplicate)

I have searched alot but did not found any solution kindly help me on this. Plus I found one extension https://amasty.com/duplicate-categories.html It duplicates all categories but not sure duplicate the products or not. May be it just assign one product to multiple categories.
Help much appreciated. :)


texts:
In my Module have a table script inside the InstallSchema class. When I ran the below commands, it's not installing.
Commands
php bin/magento cache:clean
php bin/magento setup:upgrade
php bin/magento setup:db-schema:upgrade

But I have created the same code as another new module, and I have executed the above commands it's installed.
Is there any table to clear the module version in Magento 1 like (core_resource)?


texts: BLOCK checkout.onepage.review makes checkout slow?

texts:
When I go to the checkout, it takes a long time. I used the AOE Profiler to profile and figured that one row takes up all the time. It is BLOCK checkout.onepage.review. It happens in my theme and also in the default theme. There is no checkout extension installed, so its the default checkout process. Any ideas where to continue looking?

Magento 1.9.3.2


texts: Update Quote Item before Saving to Quote Item Table

texts:
Is there a way to modify the value of the Quote item/Product item before being saved in the Quote Item table? Let say I added a product in the cart, I can see that this product is added in the Quote Item Table in the DB. Now what I want is update that value first before saving it in the DB. So basically I want to make the value of the item is_virtual set to 1. The original Product is set to is_virtual = 0 but what I want is when I add this product to cart I want to update the value in the Quote_item table for column is_virtual and set it to 1. How can I achieve this? I think it can be done via plugin or observer? Like before_set_product or something. Is this possible and available? How do I do this?
Update:
Just for reference I followed this same idea
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
    <event name="checkout_cart_product_add_after">
        <observer name="set_is_virtual" instance="Vendor\Checkout\Observer\UpdateIsVirtual" />
    </event>
</config>

And the observer is like this
<?php
namespace Vendor\Checkout\Observer;
use Magento\Framework\Event\ObserverInterface;
use Magento\Framework\App\RequestInterface;

class UpdateIsVirtual implements ObserverInterface
{
    public function execute(\Magento\Framework\Event\Observer $observer) {
        $item = $observer->getEvent()->getData('quote_item');
        $item = ( $item->getParentItem() ? $item->getParentItem() : $item );

        $item->setIsVirtual(1);
    }

}

This doesn't update the entry in the Quote Item table. I want the entry in the Quote Item table to be updated as well as it's the most important thing I need to accomplish


texts: Magento 2 : How to override fotorama.js in magento custom theme

texts:
I need to show gallery arrow always visible on product gallery page.

I tried in gallery.phtml variable arrows="always", but its not working.

I want to show both arrow always visible on product gallery.

I need to know that How to overide fotorama.js in a custom theme.

Path of fotorama lib/web/fotorama


texts: Magento 2.1.6 - Component Update update/index.php server error

texts: When trying to install a component in magento 2.1.6 every check passes, backup completes and when i go to press the install button i get directed straight to a 500 internal server error page. I have checked all permissions as per magentos documentation and everything seems fine. The URL that throws is it: update/index.php


texts: Magento 2.4.1 categories product disappear automatically

texts:
I am facing this problem since I update to the latest Magento 2.4.1 I have elastic search running but  categories product disappear automatically and I have to run the reindex command this is happening 5,6 times in a day I have 3500 SKU on my website
it shows WE CAN'T FIND PRODUCTS MATCHING THE SELECTION.
after running reindex command it starts working again for sometime
kindly help


texts: Creating a custom theme for Magento2 from the Luma theme as parent

texts:
Referencing this article below:

https://www.codextblog.com/magento-2/create-a-custom-child-theme-from-luma-theme/

Having followed all of the steps, our theme is created and applied, but none of the files are being read.

So for example, the content of the default.xml is not being applied to the site.

Any ideas of possible reasons why?

I found this article:

Magento 2 custom theme layout xml and css not working

But this isn't the issue. We have the type as 0 not 1 there.

None of the xml or CSS files we have uploaded are being read. For example, applying a Google font, is not showing in the  section of the source pages of any page. Static files have been deployed, cache cleared etc. But not overriding the Luma theme.


texts: Equivalent code of Mage::app()->getLocale()->storeTimeStamp() in Magento2

texts:
I would like to find out the magento2 equivalent of the below code from magento 1

Mage::app()->getLocale()->storeTimeStamp()

Can anyone assist me?


texts: Magento2 Correct Sequence to flush all Caches/Static files

texts:
I'm having a hard time in development with generated classes, pre-processed files and caches in Magento2.

In comparisson with Magento1 it seems no longer possible to efficiently develop when disabling all caches, plus I also need to see if caches interfere with features I build.

My problem is, that there are so many caches and generated files, I'm not sure which are dependent of each other and in what sequence I should flush them in order to get a fresh view of all my developments.

There's the Backend Cache area

All the standard caches that can be cleaned
The Catalog image cache
The Static Files cache
The CSS/JS Cache

Then there is the bash commands

php bin/magento cache:clean
php bin/magento setup:static-content:deploy

Then there folders you can manually delete

var/generation
var/cache
var/page_cache
var/view_preprocessed
pub/static

That's a lot of possibilities and probably not all. So if I deploy a large update, Code Changes, CSS/JS changes, Template changes

Which of these steps should I do to get everything cleaned? In what sequence must these steps be done?


texts:
Adding the direct bootstrap online link conflicts with the layout. I've compiled bootstrap for just the responsive grid, but cannot find exactly where to place this bootstrap.min.css and how to link it from my homepage. All i want is the responsive grid. I'm running a child theme off Luma.

Magento version 2.0.13


texts: Magento2 : different templates for multistore, how?

texts:
On magento1, I could achieve this by

1, I had my theme folder "mydesign" under frontend/default

2, Another store's folder was also added under frontend/default as "mydesign-en"

3, "mydesign-en" had a template folder under it and there I could have different template files than main store.

4, I applied on the backend configuration under design section "theme setting", for default and skin "mydesign" and for template "mydesign-en".

However, I see the design configuration is different on the backend of Magento2.

At the moment I have mytheme/mydesign under app/design/frontend.
Do I have to create another child theme as mytheme/mydesign-en to achieve this?


texts: which is more fast in rendering xml layout block or phtml create layout block in magento?

texts:
I need to know which method is faster.

<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('header_top')->toHtml(); ?>

Or the layout rendering.

<block type="cms/block" name="header_top" as="header_top" before="header">
      <action method="setBlockId"><block_id>header_top</block_id></action>
</block>


texts: How to replace a catalog price rule by a cart price rule when adding a specific product in cart?

texts:
I have a catalog price rule which give a 25% discount in all product based on a customer group.

I want to create a cart price rule which give a 30% discount in all cart when a product with SKU "ABO1" (this product won't be discount) is added to the cart but it needs to override the 25% discount of the catalog price rule.

How can i manage this ?


texts: Magento 2 Remove Page Cache in Home Page

texts:
I don't want cache to happen with home page but need them for all other pages.

I am new to Magento and on going through I found that cacheable="false" in block will ignore cache in that page.

How can I achieve this.


texts: Facing problem with custom attributes in customer address checkout

texts:
I am facing a problem adding customer address custom attributes, in Magento 2.2 is working fine but after upgrading to Magento 2.3 I am receiving this error when shipping-information is saved:

An error occurred during "shipping_address" processing. An error occurred during "customAttributes" processing. A custom attribute is specified with a missing attribute code. Verify the code and try again.

It is happening when sending shipping information, custom attributes keys are not the custom attributes labels, so when Magento validate the customer attributes it's sending the error. I don't find any difference in documentation from Magento 2.2 and 2.3 about adding custom attributes.

Here is an example of how I am adding custom attributes

$customFieldBetweenStreets = [
        'component' => 'Magento_Ui/js/form/element/abstract',
        'config' => [
            // customScope is used to group elements within a single form (e.g. they can be validated separately)
            'customScope' => 'shippingAddress.custom_attributes',
            'customEntry' => null,
            'template' => 'ui/form/field',
            'elementTmpl' => 'ui/form/element/input',
            'tooltip' => [
                'description' => 'Entre calles',
            ],
        ],
        'dataScope' => 'shippingAddress.custom_attributes' . '.' . $customAttributeCodeBetweenStreets,
        'label' => 'Entre calles',
        'provider' => 'checkoutProvider',
        'sortOrder' => 122,
        'validation' => [
            'required-entry' => true,
            'max_text_length' => 60
        ],
        'options' => [],
        'filterBy' => null,
        'customEntry' => null,
        'visible' => true,
    ];

And my set-shipping-information-mixin

return function (setShippingInformationAction) {
    return wrapper.wrap(setShippingInformationAction, function (originalAction, messageContainer) {

        var shippingAddress = quote.shippingAddress();

        if (shippingAddress['extension_attributes'] === undefined) {
            shippingAddress['extension_attributes'] = {};
        }

        if (shippingAddress.customAttributes != undefined) {
            $.each(shippingAddress.customAttributes , function( key, value ) {

                if($.isPlainObject(value)){
                    value = value['value'];
                }

                shippingAddress['customAttributes'][key] = value;
                shippingAddress['extension_attributes'][key] = value;

            });
        }

        return originalAction(messageContainer);
    });
};

});

Here the $.each(shippingAddress.customAttributes , function( key, value ) Key is returning the 0,1,2,3 etc, index while in Magento 2.2 is the custom attribute code I am adding in my Layout Processor

Any help would be appreciated


texts: I wanna have some unique selling points on my productpages

texts:
How is it possible to add some unique selling points to my productpages.
I was thinking about making a block or something?

Hope you guys can help me out.


texts: turpentine for varnish recently viewed products not working

texts:
I am running turpentine 0.7.10 on Magento CE 1.9.3.7.
The recently viewed products block at the bottom of my list pages displays products from other customers sessions when varnish is on.
I saw a lot of discussion about this but nothing seems to resolve this, is this a known bug? Is there a way I can fix this?


texts:
When  Adding a product to cart programatically ,the price of the product becomes  zero ($0.00) on the fist time , but on adding the same item to the cart, it shows the price .

The product adding is handled by Event observer method on the event "checkout_cart_add_product_complete" using the below code.

$cart = Mage::getModel('checkout/cart');
$cart->init();
$product_id=1387;
$product = Mage::getModel('catalog/product')->load($product_id);
$params = array(
    'product' => $product_id,
    'qty' =>1
    );
$cart->addProduct($product,$params);
$cart->save();
Mage::getSingleton('checkout/session')->setCartWasUpdated(true);

Please help me to solve this problem.

But when i go to cart and return to the product page the price shown or when i delete a product in the cart the price shown.


texts: Block access to a CMS page or URL unless IP has access

texts:
I have a page that I do not want anyone to see except staff, there is no sensitive data on the page, I just do not want it accessible to everyone.

Is there a way to block access to website.co.uk/page for everyone not on my network?

I can set up password protection but I do not want this.

Thanks

edit

This works on the test site:

RewriteEngine on

    RewriteCond %{REMOTE_ADDR} !^xx\.xx\.xx\.xx$
    RewriteRule ^page/? - [F,NC]

But I have added it to the live site and I cannot access this page as I believe that the website is seeing my CDN IP address and not mine, is there a way around this?


texts: Magento2 showing wrong data for low stock report for multiple warehouse

texts: I have set new source and new stock and assigned new stock in product, when i check low stock report its not showing updated data for new source and stocks, its always showing default stock data, can anyone help me regarding this?


texts: I am looking for a quality search plugin

texts: I am looking for a plug in to expand search functionality.  May I ask for recommendations and if there are pros or cons to others?


texts:
What is helper in Magento?

In what cases should one use and not use helpers?


texts: User login not work after SUPEE-8788 Patch

texts:
our provider has patch our Magento 1.7.02 version today. After this the login from users doesn't work anymore.

After sent username and passwort the fields are empty but nothing changes

Any idea?


texts:
How to modify the tracking link on both admin and frontend so that when I click on the link track this shipment, it opens directly to carrier page ?

I want it to open https://www.paket.id/is/MPMTD instead of magento/shipping/tracking/[...]

This is how I changed the carrier URL:

public function getTrackingInfo($tracking)
{
    $track = Mage::getModel('shipping/tracking_result_status');
    $track->setUrl('https://www.paket.id/is/' . $tracking)
       ->setTracking($tracking)
       ->setCarrierTitle($this->getConfigData('name'));
    return $track;
}

I have googled how to modify this pop-up but I didn't find any solution. And, is it possible to modify it?


texts: Does having a lot of NULL values slow down my site?

texts:
I have a store with about 13k skus. The company that I'm doing the job for hasn't broken anything down into attribute sets.
The result is that an attribute that's used on 10 products gets added to the attribute set, resulting in 12,900 NULL values.
That's just one, and there are dozens of attributes like this, leading to hundreds of thousands of NULL values.
The site is running slow, even though it has dedicated hosting on AWS with Cloudways, and 16gb RAM.
Do I need to tell them that they have to break things down by attribute set, or should I keep looking for a different reason why things are slow?
Thanks


texts: How to override catalog_product_view.xml?

texts:
I want to have a different theme on special products.
So I have a main theme
--> app/design/frontend/Main/Default
and I want a different theme, which is child of my main:
-- app/design/frontend/Special/Default

How can I override the catalog_product_view.xml in the special theme, based on main theme? Placing the xml in the "Magento_Catalog/layout/" doesnt work.


texts: How do I get a collection of all products across all stores at once?

texts:
In Magento's admin panel, in the Catalog -> Manage Products section, it shows all the products across all the store views of your website.

I'd like to export this data - literally all of my products from every store - but I can't seem to access the data in an external PHP script.

Here's what I'm trying:

Mage::app();

$products = Mage::getModel("catalog/product")
            ->getCollection()
            ->addAttributeToSelect("id");

The above collection seems to contain only the products for my default store.

I've also tried adding ->addAttributeToFilter("website", array("in", array("1", "2", "3"))) etc. but this also does nothing to change the number of products.

Adding a store code into Mage::app() changes the result of the collection, but obviously I want all the products and not just a single store's.

I know this is possible because Magento itself does it under Manage Products - but how?

TL;DR I want a collection of all the products in my Magento installation from all stores. How?


texts:
I got an error when i execute this command

php bin/magento setup:upgrade &&
php bin/magento setup:di:compile &&
#php bin/magento setup:static-content:deploy &&
chown -R www-data:www-data . &&

rm -rf var/cache &&
rm -rf var/di &&
rm -rf var/page_cache/ &&
rm -rf var/generation/ &&
rm -rf var/view_preprocessed/

the error is

  "Use of undefined constant MCRYPT_RIJNDAEL_256 - assumed 'MCRYPT_RIJ     NDAEL_256"

when i was checking my server, and show the phpinfo(), the extension for mcrypt has been enabled properly, so what is the real problem?


texts: Shop by Brand/Manufacturer custom URL in M1

texts:
I am using Magento 1.9.3, and if i want to see on frontend only the products from a specific brand (manufacturer attribute), the url is something like:

http://example.com/shop?manufacturer=4

Everything ok, products from manufacturer with id 4 are listed. The problem is that i want to use manufacturer name/content (My Brand), like this:

http://example.com/my-brand/

I have tried to use url rewrite, but the url works only as a redirect to the long way (with GET parameter).

I searched a lot, but couldn't find anything helpful, so any help ideas are welcome.


texts: Price slider extension is not working in Magento 2.3

texts:
I have installed the free third party extension for price slider in Magento 2. After installing the extension, I ran upgrade, deploy, cache commands but I'm getting the below error:

Exception #1 (PDOException): SQLSTATE[42S22]: Column not found: 1054 Unknown column 'e.created_in' in 'where clause'

I have also tried running reindex command but still there is an error.

Could anyone please help me how to rectify this error?


texts: How to override AbstractMethod Capture function Magento 2

texts:
I need to update amount in capture function of abstract method. For this I have created a plugin.

/**
 * Copyright © 2015 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */
namespace Vendor\MyModule\Model\Plugin;

class OrderCapture extends \Magento\Payment\Model\Method\AbstractMethod
{
    public function capture(\Magento\Payment\Model\InfoInterface $payment, $amount)
    {
        print_r($payment);
        exit;
    }

}

It is not reflecting any changes when I place an order.

Please do suggest


texts: Magento2: breadcrumbs disappeared from product page after upgrading to 2.2.4

texts:
I upgraded Magento to 2.2.4 & now I don't have breadcrumbs on product pages.
They show up on other pages but not on products.
I checked the source & noticed that there is a div with the 'breadcrumbs' class & some json params, but it's empty (no errors on console).

Any idea?

UPDATE:
I found out that for a reason I can't explain , Magento started building the breadcrumbs of the product pages based on the top-menu navigation using JS & since in my case I changed the menu & used different CSS selectors, it stopped working.
I believe that now I'll be able to fix this, but I can't see any good reason for them to do that, it's way too fragile...

My Temporary Workaround (If it helps someone...):
1. Build a module & add a block that extends \Magento\Theme\Block\Html\Breadcrumbs in order to add the method getCrumbs() *No need for di.xml

namespace Vendor\Module\Block\Html;

class Breadcrumbs extends \Magento\Theme\Block\Html\Breadcrumbs
{
    public function getCrumbs()
    {
        return $this->_crumbs;
    }

    public function getBaseUrl()
    {
        return $this->_storeManager->getStore()->getBaseUrl();
    }
}

2. Override the breadcrumbs template on product page (app/design/frontend/Vendor/Theme/Magento_Catalog/templates/product/breadcrumbs.phtml)

<?php
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$catalogData = $objectManager->create('Magento\Catalog\Helper\Data');
$crumbs = false;
if ($breadcrumbsBlock = $objectManager->create('Vendor\Module\Block\Html\Breadcrumbs')) {
    $breadcrumbsBlock->addCrumb(
        'home',
        [
            'label' => __('Home'),
            'title' => __('Go to Home Page'),
            'link' => $breadcrumbsBlock->getBaseUrl()
        ]
    );
    $path = $catalogData->getBreadcrumbPath();
    foreach ((array)$path as $name => $breadcrumb) {
        $breadcrumbsBlock->addCrumb($name, $breadcrumb);
    }
    $crumbs = $breadcrumbsBlock->getCrumbs();
}
?>
<?php if ($crumbs && is_array($crumbs)) : ?>

            <?php foreach ($crumbs as $crumbName => $crumbInfo) : ?>
                <li class="item <?= /* @escapeNotVerified */ $crumbName ?>">
                <?php if ($crumbInfo['link']) : ?>
                    <a href="<?= /* @escapeNotVerified */ $crumbInfo['link'] ?>" title="<?= $block->escapeHtml($crumbInfo['title']) ?>"><?= $block->escapeHtml($crumbInfo['label']) ?>
                <?php elseif ($crumbInfo['last']) : ?>
                    <?= $block->escapeHtml($crumbInfo['label']) ?>
                <?php else: ?>
                    <?= $block->escapeHtml($crumbInfo['label']) ?>
                <?php endif; ?>

            <?php endforeach; ?>

<?php endif; ?>


texts: Which web hosting company is best for Magento 2 Ecommerce development

texts:
For the 1st time ,I build eCommerce website using Magento2 open-source.

Please help!

Which web hosting company is best for Magento 2 eCommerce development


texts: How to change the PDF invoice list format, in Magento2?

texts:
I have managed to create a module, and overwrite the \Magento\Sales\Model\Order\Pdf\Invoice class, using the steps proposed by this answer: https://magento.stackexchange.com/a/241932/80959

My question is how do I edit the _drawItem() method?

In the original implementation all the data is sent to some product renderer object:

/**
 * Draw Item process
 *
 * @param  \Magento\Framework\DataObject $item
 * @param  \Zend_Pdf_Page $page
 * @param  \Magento\Sales\Model\Order $order
 * @return \Zend_Pdf_Page
 */
protected function _drawItem(\Magento\Framework\DataObject $item, \Zend_Pdf_Page $page, \Magento\Sales\Model\Order $order)
{
    $type = $item->getOrderItem()->getProductType();
    $renderer = $this->_getRenderer($type);
    $renderer->setOrder($order);
    $renderer->setItem($item);
    $renderer->setPdf($this);
    $renderer->setPage($page);
    $renderer->setRenderedModel($this);

    $renderer->draw();

    return $renderer->getPage();
}

I don't understand it's purpose, nor I am able to find it's source code.

Should I discard that code altogether and start drawing each value? Or is there a purpose for that renderer, case in which I might lose some functionality?


texts: In magento1.9,I want to track commission and transaction done by social site in affiliate marketing?

texts:
When customer doing shopping through affiliate sharing the link by Facebook or another social site then how to track affiliate commission and transaction done by social sites?

I am using magebuzz affiliate extension.


texts: How to add additional information in order info tab

texts:
I want to add credit card additional information in the section payment.

How to do it?


texts: I want some customization theme luma in my magento 2 website, so I need add in header for all pages banner - custom blocki created - (banner-section) below menu and in footer I need add custom block (listing-area) above footer, what I need add in default.xml for display these blocks? Thanks.


texts: To add one single validation for checkbox group and input field

texts:
I have created a custom form in magento 2. I have placed a checkbox group having different company names as checkbox values like cmpy1, cmpy2, cmpy3 etc. I have also added an input field inside that group for which If somebody didn't belong to the specified company than he/she can enter their own company name.
Now I want to give a required validation to this group and I want to use magento 2's default validation if possible.


texts:
After downgrade magento 2.3.5-p1 to magento 2.3.4 getting error when setup upgrade command fire

An abstract factory could not create an instance of magentoframeworkappdeploymentconfig(alias: Magento\Framework\App\DeploymentConfig).


texts: Magento 2 - Adding external link for Font Awesome URL

texts:
Here I am making my own theme and I want to add font-awesome external URL. I have created a file in my custom-theme directory in the path

  app/design/frontend/vendor/theme_name/Magento_Theme/layout/default_head_blocks.xml.

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <head>
        <link rel="stylesheet" type="text/css" src="https://use.fontawesome.com/releases/v5.7.2/css/all.css"
          integrity="sha384-fnmOCqbTlWIlj8LyTjo7mOUStjsKC4pOpQbqyi7RrhN7udi9RwhKkMHpvLbHG9Sr" crossorigin="anonymous" src_type="url" />
    </head>
</page>

I am following this link https://devdocs.magento.com/guides/v2.0/frontend-dev-guide/layouts/xml-manage.html

But after clearing the cache, I could not find the font-awesome link in the view source.

Please guide me. How to fix this issue?


texts: Correct Process for Editing an Admin Order

texts:
This one confuses me quite alot and I'm wondering if someone can outline the correct process to edit an order.
My Confusion:

I open the order and click Edit
I complete the order form and create the product (New ID appended with -1 & Status Pending)
I open the -1 order and invoice which sets it to processing.
Now I am unsure what to do with the original order, it gives you the options to Edit, Credit Memo, Hold and Ship.

What should I do with the original Order?

Hope someone can explain it to me.

Thanks,
Paul


texts: How do I get all products in a category?

texts:
Consider my 'shorts' category below. It has 149 products in. 13 are configurable, the rest are simple products that have a visibility of 'Not visible individually'.

I have the following:

$category = $this->categoryRepositoryFactory->create();
$category = $category->get(20);

$collection = $this->productCollectionFactory->create();
$collection->addAttributeToSelect('*');
$collection->addAttributeToFilter('visibility', [1,2,3,4]);
$collection->addCategoryFilter($category);
$collection->setOrder('cat_index_position','DESC');

This only retrieves the 13 records with the Configurable products with visibility of 'Catalog, Search'.

(It also doesn't order by position, but that's another matter)

I want to get a list of ALL of the products in the category - Not visible included.

I have tried reindexing, cache etc, but no luck.


texts: I went in the advanced setting and disabled mage core.  I have no more admin area.  I do I restore mage core.


texts: Set Link On Admin Menu Grid values in Magento 2

texts:
I want to add link in Custom Menu Grid values, so for achieving this I add a class in my layout file and in the class file i do this following

<?php

namespace Feedback\Addon\Ui\Component\Listing\Columns;

use Magento\Framework\View\Element\UiComponentFactory;
use Magento\Framework\View\Element\UiComponent\ContextInterface;

class UserEmail extends \Magento\Ui\Component\Listing\Columns\Column
{
    /**
     * Prepare Data Source
     *
     * @param array $dataSource
     * @return array
     */
    public function prepareDataSource(array $dataSource)
    {
        if (isset($dataSource['data']['items']))
        {
            $fieldName = $this->getData('email');
            foreach ($dataSource['data']['items'] as & $item)
            {
                if (isset($item['email']))
                {
                    $path = $this->context->getUrl('customer/index/edit/',['id'=>244]);

                    $url = "".$item['email']."";

                    $item['email'] = 'context->getUrl('customer/index/edit/',['id' => 224]).'">'.$item['email'].'';

                    $item[$name] = html_entity_decode('urlBuilder->getUrl(self::PRODUCT_URL_PATH_EDIT, ['id' => $item['product_id']]).'">'.$item['product_id'].'');
                }
            }
        }

        return $dataSource;
    }
}

it will return the  tag not the link, so please tell me what should I do


texts: Print invoice format is not proper in customer dashboard Magento ver. 1.9.2.1

texts:
I am getting below format of invoice , when customer Print there invoice form there Dashboard.

Which files are responsible for the same.

I replaced sales folder under /app/design/frontend/base/default/template/sales with fresh sales folder.

still format is same

NOTE: There is no sales folder in theme template folder.
Thank you.


texts:
I've build a Magento 2 admin grid using ui-components.
But I don't want the default paging of 20, 30, 50, ....
I want my own values.
For example 1,2 and 3.
I remember that in a beta version I could have done this inside my ui-component grid file

    <paging name="listing_paging">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="options" xsi:type="array">
                    <item name="1" xsi:type="array">
                        <item name="value" xsi:type="number">1</item>
                        <item name="label" xsi:type="string" translate="true">1</item>
                    </item>
                    <item name="2" xsi:type="array">
                        <item name="value" xsi:type="number">2</item>
                        <item name="label" xsi:type="string" translate="true">2</item>
                    </item>
                    <item name="3" xsi:type="array">
                        <item name="value" xsi:type="number">3</item>
                        <item name="label" xsi:type="string" translate="true">3</item>
                    </item>
                </item>
            </item>
        </argument>
    </paging>

But that doesn't work anymore.
Is there a way to do that in 2.1?

And as a bonus question, How can I allow or restrict the custom value option?


texts:
Is there a way to add a dropdown to a simple product, that's giving alternative products and when selecting, it navigates to that product?

For example I have the following product:

Apple iPad Pro 128GB Wi-Fi 12.9'' - Gold

I want to add a dropdown with the values, to switch to that product:

Apple iPad Pro 128GB Wi-Fi 12.9'' - Silver
Apple iPad Pro 128GB Wi-Fi 12.9'' - Space Grey

Each of these values are unique simple products, with there own SKU.

When selecting a dropdown value, I want to redirect the page to that specific product.

Is that possible with simple products and how?


texts: Create new customer using CLI like admin

texts: There is the way to create admin user using CLI php bin/magento admin:user:create. Is there the same way to create the new customer for front-end access ?


texts: how to skip user to go to checkout page,add a third party checkout button on cart page

texts:
I am integrating Pilibaba payment gateway in my magento site . they have there checkout form . So can anybody explain me how can i add a button on cart page directly which will redirect me to that pilibaba request page. i am worried because orders are created in magento after place order step in checkout page .
thanks


texts: Don't want to save credit card information in database

texts:
I have used magento default payment method CC Saved. But, I dont want to save the credit card number in the database. How to override the core files in this case?

I tried with sales_order_save_after event. But not get the actual result as expected. If use this event, we can just update the card number as NULL. But, I don't want to save the credit card number in database.

I don't want to add 3rd party merchant. Because, I need to send the payment details to separate API. They will handle the payment process.

Thanks


texts:
I have some patches I'd like to test on a development server dev.example.com.

I plan to take a copy of the files, install them in the web folder for dev.example.com, create a new database, and do a find and replace in the SQL export replacing www.example.com with dev.example.com, and import this into the new database, and alter the local configuration files with the new database connection settings.

Can it be this simple?

Thanks.


texts: I want to find in code place, where PayPal query sends, with Payflowpro Credit/Debit card payment method on checkout. Please, help me with it.