texts: Admin page Problem after upgrade from magento 2.3.5-p1 to magento 2.3.5-p2

texts:
After upgrade from magento 2.3.5-p1 to magento 2.3.5-p2
when I try to use the admin panel almost all menu button not responding.
only the Dashboard button working.
I dont get any error in logs.
I also tried to compile, deploy and clean cache.
www.ttu.co.il/:14 Refused to load the stylesheet 'https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css' because it violates the following Content Security Policy directive: "style-src getfirebug.com *.googleapis.com 'self' 'unsafe-inline'". Note that 'style-src-elem' was not explicitly set, so 'style-src' is used as a fallback.
www.ttu.co.il/:1 Refused to load the script 'https://ajax.cloudflare.com/cdn-cgi/scripts/7089c43e/cloudflare-static/rocket-loader.min.js' because it violates the following Content Security Policy directive: "script-src assets.adobedtm.com geostag.cardinalcommerce.com 1eafstag.cardinalcommerce.com geoapi.cardinalcommerce.com 1eafapi.cardinalcommerce.com songbird.cardinalcommerce.com includestest.ccdc02.com www.googleadservices.com www.google-analytics.com secure.authorize.net test.authorize.net www.paypal.com www.sandbox.paypal.com www.paypalobjects.com t.paypal.com s.ytimg.com video.google.com vimeo.com www.vimeo.com js.authorize.net jstest.authorize.net js.braintreegateway.com cdn-scripts.signifyd.com www.youtube.com *.googleapis.com *.addthis.com *.moatads.com *.addthisedge.com *.facebook.com *.pinterest.com 'self' 'unsafe-inline' 'unsafe-eval'". Note that 'script-src-elem' was not explicitly set, so 'script-src' is used as a fallback.

I would appreciate any help


texts: Magento2 configurable product - multiple options prices

texts:
I run into a strange issue with creating configurations for a configurable product via magento2 backend.
The following scenario:
I want to create a configurable product with 3 attributes so I did

in backend click "create new product (configurable)"
click on "create configurations"
select 3 attributes with all their possible values
and now I want to enter the price for their possible values in relation to each other, but the interface let me only select on attribute

I want to input prices for the available combinations of attributes/options:

(attribute1/option1) + (attribute2/option1) + (attribute3/option1)

(attribute1/option1) + (attribute2/option1) + (attribute3/option2)

(attribute1/option1) + (attribute2/option2) + (attribute3/option1)

(attribute1/option1) + (attribute2/option2) + (attribute3/option2)

(attribute1/option2) + (attribute2/option1) + (attribute3/option1)

(attribute1/option2) + (attribute2/option1) + (attribute3/option2)

(attribute1/option2) + (attribute2/option2) + (attribute3/option1)

(attribute1/option2) + (attribute2/option2) + (attribute3/option2)

But it seems to be impossible through the provided interface...
Did anyone get a solution to input those prices?


texts: How to update 'number' of items added to cart pop up?

texts:
When I add an item to cart, it is getting displayed in cart pop up. But the numer of item is not getting upadted. Below is my coding to display the items in cart pop up. Someone please guide me to update the number when the product is added to cart.

 <?php $cartitem = $this->getRecentItems() ?>
        <?php if(count($items)): ?>
                <?php $quote = Mage::getSingleton('checkout/session')->getQuote();
                $cartItems = $quote->getAllVisibleItems(); ?>
                    <?php foreach($cartItems as $_item): ?>
                            <?php $options = $_item->getProduct()->getTypeInstance(true)->getOrderOptions($_item->getProduct()); ?>
                            <?php $isVisibleProduct = $_item->getProduct()->isVisibleInSiteVisibility();?>
                            <?php $product = $_item->getProduct(); ?>
                            <?php echo "

"; ?>
                            <a href="<?php echo $product->getProductUrl() ?>" title="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" class="product-image"><img src="<?php echo $this->helper('catalog/image')->init($product, 'small_image')->resize(50, 50); ?>" width="50" height="50" alt="<?php echo $this->stripTags($this->getImageLabel($product, 'small_image'), null, true) ?>" />
                            <?php echo $_item->getName(); ?>

                            <?php
                                foreach($options['attributes_info'] as $key => $value){
                                    echo ':'.$value['value'];
                                }
                            ?>

                            <?php echo $_item->getQty();?> X
                            <?php echo $this->helper('checkout')->formatPrice($_item->getCalculationPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()); ?>
                                    <?php $url=$this->getUrl('checkout/cart/delete',array('id'=>$_item->getId())); ?>
                            <a href="<?php echo $url ?>" title="<?php echo $this->__('Remove This Item') ?>" onclick="return confirm('<?php echo $this->__('Are you sure you would like to remove this item from the shopping cart?') ?>');" class="btn-remove"><?php echo $this->__('Remove This Item') ?>

                            <?php echo "

" ?>
                    <?php endforeach; ?>
     <?php else: ?>

 <?php /*echo $this->__('You have no items in your shopping cart.')*/ ?>

                         Your Shopping Cart is empty.

                 Start shopping!

<?php endif ?>

<a href='<?php echo $this->getUrl("checkout/cart"); ?>'>View Cart

The number should be added between the brackets of below image


texts: Magento CE 1.5 creating a new var directory

texts:
In a Magento CE 1.5 installation Magento sometimes creates new var directories (var1, var2).
As far as I can see Magento continues to work fine and nothing is wrong with the old directories but it'd like to know what causes this.


texts: Category Not showing in New product upload

texts: When I try to upload a product in Magento and go to the area where you select which category the product should show up for it shows all categories except the one I just created. I made sure this category had all the same settings at the others.


texts: Magento 2 : How to add custom data in order email

texts:
I am new to Magento. I want to override the new order email template and add custom details in the order email. Please help.
Steps I have done
1. I have created a new email template and assign it to a new order in from the admin panel and a section for custom details. it is working fine. But I don't know how to bind custom value
2. I have created an observer after order success action and save custom data in sales_order against order id.
  public function execute(\Magento\Framework\Event\Observer $observer)
  {
   /* get customer store and restaurant data */
   $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
   $customerSession = $objectManager->get('Magento\Customer\Model\Session');

   $c_id = $customerSession->getCustomer()->getId();
   $c_store_id = $customerSession->getCustomer()->getData('stores');

   $store= $objectManager->get('Vendor\Store\Model\Template');
   $store_name = ($store->load($c_store_id)->getName());
   $store_restaurant_id = ($store->load($c_store_id)->getRestaurantId());

   $restaurant = $objectManager->get('Vendor\Restaurant\Model\Template');
   $restaurant_name = ($restaurant->load($store_restaurant_id)->getName());

    $orderids = $observer->getOrderIds();
    $orderId = "";

        foreach($orderids as $orderid){
            $order = $this->_order->load($orderid);
                $orderId = $orderid;
        }
    // Here I am saving custom data
    $order->setData('restaurant_name', $restaurant_name )
            ->setData('res_store_name', $store_name);
  }


texts: Fatal Error on Magento 2.3 installation process (localhost/magento)

texts:
Fatal error: Uncaught Exception: Warning: "continue" targeting switch
  is equivalent to "break". Did you mean to use "continue 2"? in
  C:\xampp\htdocs\magento\vendor\zendframework\zend-stdlib\src\ArrayObject.php
  on line 426 in
  C:\xampp\htdocs\magento\vendor\magento\framework\App\ErrorHandler.php:61
  Stack trace: #0
  C:\xampp\htdocs\magento\vendor\composer\ClassLoader.php(444):
  Magento\Framework\App\ErrorHandler->handler(2, '"continue" targ...',
  'C:\xampp\htdocs...', 426, Array) #1
  C:\xampp\htdocs\magento\vendor\composer\ClassLoader.php(444):
  include() #2
  C:\xampp\htdocs\magento\vendor\composer\ClassLoader.php(322):
  Composer\Autoload\includeFile('C:\xampp\htdocs...') #3 [internal
  function]:
  Composer\Autoload\ClassLoader->loadClass('Zend\Stdlib\Arr...') #4
  C:\xampp\htdocs\magento\vendor\zendframework\zend-stdlib\src\Parameters.php(29):
  spl_autoload_call('Zend\Stdlib\Arr...') #5
  C:\xampp\htdocs\magento\vendor\zendframework\zend-http\src\PhpEnvironment\Request.php(67):
  Zend\Stdlib\Parameters->__construct(Array) #6 C:\xamp in
  C:\xampp\htdocs\magento\vendor\zendframework\zend-servicemanager\src\ServiceManager.php
  on line 941


texts: Magento 2 hide shipping methods based on product attribute & shipping address out of USA

texts:
I Would like to hide shipping methods and display a custom message on the checkout page & cart page based on product attribute flag & if the shipping address is outside of the USA.

I used the below plugin but it triggers only logged-in users unable to verify with guest users.

Could you please advise what exact plugin or method want to use?

Note: It should work guest users & registered customers

app/code/Vendor/ShippingRestriction/etc/di.xml

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd">

    <type name="Magento\Quote\Model\ShippingMethodManagement">
        <plugin name="disableshippingmethod" type="Vendor\ShippingRestriction\Plugin\ShippingMethodManagementPlugin"/>
    </type>
</config>

app/code/Vendor/ShippingRestriction/Plugin/ShippingMethodManagementPlugin.php

<?php
namespace Vendor\ShippingRestriction\Plugin;
use Psr\Log\LoggerInterface;
use Exception;
use Magento\Quote\Model\QuoteFactory;
class ShippingMethodManagementPlugin
{
    /**
     * @var LoggerInterface
     */
    private $logger;

    /**
     * @var QuoteFactory
     */
    protected $quoteFactory;

    /**
     * ShippingMethodManagementPlugin constructor.
     * @param LoggerInterface $logger
     * @param \Magento\Customer\Api\AddressRepositoryInterface $addressRepository
     * @param QuoteFactory $quoteFactory
     */
    public function __construct(
    LoggerInterface $logger,
    \Magento\Customer\Api\AddressRepositoryInterface $addressRepository,
    \Magento\Quote\Model\QuoteFactory $quoteFactory
    )
    {
        $this->addressRepository = $addressRepository;
        $this->logger = $logger;
        $this ->quoteFactory = $quoteFactory;
    }

    /**
     * @param \Magento\Quote\Model\ShippingMethodManagement $subject
     * @param $result
     * @param $cartId
     * @param $addressId
     * @return mixed
     */
    public function afterEstimateByAddressId(\Magento\Quote\Model\ShippingMethodManagement $subject, $result, $cartId, $addressId)
    {
        $quote = $this->quoteFactory->create()->load($cartId);
        $items = $quote->getAllVisibleItems();
        $productAttributeValues = array();
        $shippWithinUsaFlag = ['1'];
        foreach ($items as $item) {
            $productAttributeValues[$item->getSku()] = $item->getProduct()->getData('ship_only_within_usa');
        }

        //Fetch current Country Id US/IN based on shipping address id
        $countryIdFlag = $this->getCustomerAddress($addressId);
        //Unset shipping methods based on product attribute & shipping address
        $restrictionFlag = (count(array_intersect($productAttributeValues, $shippWithinUsaFlag))) ? '1' : '0';
        if($countryIdFlag !== "US" && $restrictionFlag === '1'){
            /** @var TYPE_NAME $result */
            foreach ($result as $key => $shippingMethod) {
                 unset($result[$key]);
            }

        }
        return $result;
    }

    /**
     * @param $addressId
     * @return null|string
     */
    public function getCustomerAddress($addressId)
    {
        $countryId = null;
        try {
            $addressRepository = $this->addressRepository->getById($addressId);
            $countryId=$addressRepository->getCountryId();
            return $countryId;
        }  catch (Exception $exception) {
            $this->logger->error("Something went wrong with customer address".$exception->getMessage());
        }
        return $countryId;
    }

}


texts: After installing Magento 2.0.2 is very slow in loading home/admin page

texts:
I installed magento 2.0.2 on WAMP 2.5 successfully but I see home/admin page takes at least 3-4 mins to get loaded and the case is same in page navigation. Kindly help me in getting my pages loaded faster . Below are my env details

OS:Windows 7 64 bit
WAMP:2.5
RAM:8GB

Early helps are appreciated .

Thanks
Kotresh NM


texts:
I am facing following exception

  Template filter error: Type Error occurred when creating object

I am getting this exception when I am injecting block \Magento\Catalog\Block\Product\ListProduct in my custom block \Anshu\CustomModule\Block\Custom

<?php
declare(strict_types=1);

namespace Anshu\CustomModule\Block;

use Magento\Catalog\Block\Product\ListProduct;
use Magento\Catalog\Pricing\Price\FinalPrice;
use Magento\Customer\Model\Session;
use Magento\Framework\Pricing\Render;
use Magento\Framework\View\Element\Template;
use Magento\Framework\View\Element\Template\Context;
use Anshu\Custom\Helper\ProductCollection;

class Custom extends Template
{
    private $listProduct;

    private $productCollection;

    private $customerSession;

    public function __construct(
        ListProduct $listProduct,
        ProductCollection $productCollection,
        Session $customerSession,
        Context $context,
        array $data = []
    ) {
    parent::__construct($context, $data);
        $this->listProduct = $listProduct;
        $this->productCollection = $productCollection;
        $this->customerSession = $customerSession;
    }

    public function getProducts()
    {
        $collection = $this->productCollection->getProductCollection();
        $collection->addAttributeToSelect('custom_attribute');
        $collection->addAttributeToFilter('custom_attribute', 1);

        return $collection;
    }

    public function getCustomerGroupId() :int
    {
        return $this->customerSession->getCustomerGroupId();
    }

    public function getPrice($product) :string
    {
        $priceRender = $this->getLayout()->getBlock('product.price.render.default');
        if (!$priceRender) {
            $priceRender = $this->getLayout()->createBlock(
                Render::class,
                'product.price.render.default',
                ['data' => ['price_render_handle' => 'catalog_product_prices']]
            );
        }

        $price = '';
        if ($priceRender) {
            $price = $priceRender->render(
                FinalPrice::PRICE_CODE,
                $product,
                [
                    'display_minimal_price'  => true,
                    'use_link_for_as_low_as' => true,
                    'zone' => Render::ZONE_ITEM_LIST
                ]
            );
        }

        return $price;
    }

    public function getAddToCartPostParams($product) :array
    {
        return $this->listProduct->getAddToCartPostParams($product);
    }
}

Let me know if anyone aware of this type of issue, what is causing this issue and how this can be fixed


texts:
I am quite newbie to the Magento. Currently I am doing a theme. In that I want to show all the products from featured category. For that I have done a file called featred.phtml inside
/app/design/frontend/mytheme/default/template/catalog/product. The code for featured.phtml is like this

<?php $cat_id = 35; ?>
<?php $category = Mage::getModel('catalog/category')->load($cat_id);?>
<?php $collection = $category->getProductCollection()->addAttributeToSort('position');?>
<?php Mage::getModel('catalog/layer')->prepareProductCollection($collection);?>
<?php  $i=0; foreach ($collection as $_product):?>
<?php if($i++%7==0): ?>

  <?php endif ?>

<?php echo $this->htmlEscape($_product->getName()) ?>

<?php echo $formattedSpecialPrice = Mage::helper('core')->currency($_product->getFinalPrice(),true,false);?>

<?php echo $_product->_data['short_description']; ?>

    <a class="da-link" href="<?php echo $_product->getProductUrl() ?>">Shop Now

<img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(90, 90); ?>" width="120" height="120" alt="<?php echo $this->htmlEscape($_product->getName()) ?>" />

   <?php endforeach ?>

Now Here I am getting al the featured product. After that I want to show all the featured product in my header. For that I have made a block in page.xml(app/design/frontend/mytheme/default/layout) like this

<block type="catalog/product_featured" name="product.featured" as="topSlider" translate="label">
  Page Slider
  <action method="setElementClass"><value>top-slider</value></action>
</block>

Now I called that block in header.phtml like this

<?php echo $this->getChildHtml('topSlider'); ?>

But after all this I can't see any of the featured product in my home page or in any other pages. So can someone kindly tell me how to solve this issue? Any help and suggestions will be really appreciable. Thanks


texts: Magento2 Product detail page add checkbox before add to cart button

texts:
In a Product Detail Page after Quantity add checkbox when checkbox button is checked than "add to cart" button stay active if not click on checkbox than disable button.

Thanks,


texts: Fresh Magento 2.3 installation with error: "Area code "version[set of numbers]" does not exist"

texts:
I installed Magento 2.3 with apache, nginx etc.
The frontend and backend both load with multiple CSS and 404 errors.
When I open each error by rightclicking and 'opening with new tab', the same error appears for each error:
Area code "version1608495748" does not exist

#0 E:\domains\magento\vendor\magento\framework\App\State.php(56): Magento\Framework\App\State->checkAreaCode('version16084957...')
#1 E:\domains\magento\vendor\magento\framework\Interception\Interceptor.php(58): Magento\Framework\App\State->setAreaCode('version16084957...')
#2 E:\domains\magento\vendor\magento\framework\Interception\Interceptor.php(138): Magento\Framework\App\State\Interceptor->___callParent('setAreaCode', Array)
#3 E:\domains\magento\vendor\magento\framework\Interception\Interceptor.php(153): Magento\Framework\App\State\Interceptor->Magento\Framework\Interception\{closure}('version16084957...')
#4 E:\domains\magento\generated\code\Magento\Framework\App\State\Interceptor.php(52): Magento\Framework\App\State\Interceptor->___callPlugins('setAreaCode', Array, Array)
#5 E:\domains\magento\vendor\magento\framework\App\StaticResource.php(129): Magento\Framework\App\State\Interceptor->setAreaCode('version16084957...')
#6 E:\domains\magento\vendor\magento\framework\App\Bootstrap.php(258): Magento\Framework\App\StaticResource->launch()
#7 E:\domains\magento\pub\static.php(13): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\StaticResource))
#8 {main}

I researched this issue and found no mention of this specific error.
Any assistance would be greatly appreciated.


texts:
I'm getting a 'One or more indexers are invalid. Make sure your Magento cron job is running.' and it seems I need to run php bin/magento indexer:reindex from the CLI.
I get the index rebuilt successfully on all indexes but one the Catalog Search
This is the Command along with the full success and error message.

 PS C:\wamp64\www\magento2> php bin/magento indexer:reindex
Design Config Grid index has been rebuilt successfully in 00:00:05
Customer Grid index has been rebuilt successfully in 00:00:07
Category Products index has been rebuilt successfully in 00:00:02
Product Categories index has been rebuilt successfully in 00:00:00
Catalog Rule Product index has been rebuilt successfully in 00:00:04
Product EAV index has been rebuilt successfully in 00:00:01
Stock index has been rebuilt successfully in 00:00:01
Inventory index has been rebuilt successfully in 00:00:00
Catalog Product Rule index has been rebuilt successfully in 00:00:00
Product Price index has been rebuilt successfully in 00:00:01
Catalog Search indexer process unknown error:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">

<title>405 Method Not Allowed</title>

Method Not Allowed

The requested method PUT is not allowed for the URL /magento2_product_1_v1.

<address>Apache/2.4.35 (Win64) PHP/7.2.10 Server at 127.0.0.1 Port 80</address>

I'm using -
magento 2 v2.3.0
wamp v3.1.4
php v7.2.10
windows 10


texts: Different currency for an price attribute

texts:
I have an issue in magento 1.9 about the "special_price" attribute currency in the backoffice.
For the packaged product, the currency of this attribute (special_price) is "THB" whereas the other attribute is "EUR" and it's only for the product type "packaged".
Here a screenshot

Somebody can help me to fix this please ?
Thanks


texts: Magento 2: what is the catalog_attributes.xml file?

texts:
I noticed that Magento 2 contains several catalog_attributes.xml files in the following folders:

app/code/Magento/Bundle/etc
app/code/Magento/Catalog/etc
app/code/Magento/CatalogSearch/etc
app/code/Magento/CatalogUrlRewrite/etc
app/code/Magento/Downloadable/etc
app/code/Magento/GiftMessage/etc
app/code/Magento/Msrp/etc
app/code/Magento/Sales/etc
app/code/Magento/Tax/etc
app/code/Magento/Wishlist/etc

Those files look like this (example for the Sales file):

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Catalog:etc/catalog_attributes.xsd">
    <group name="quote_item">
        <attribute name="sku"/>
        <attribute name="type_id"/>
        <attribute name="name"/>
        <attribute name="status"/>
        <attribute name="visibility"/>
        <attribute name="price"/>
        <attribute name="weight"/>
        <attribute name="url_path"/>
        <attribute name="url_key"/>
        <attribute name="thumbnail"/>
        <attribute name="small_image"/>
        <attribute name="tax_class_id"/>
        <attribute name="special_from_date"/>
        <attribute name="special_to_date"/>
        <attribute name="special_price"/>
        <attribute name="cost"/>
        <attribute name="gift_message_available"/>
    </group>
</config>

What are those files used for ?


texts: Tracking down a getChildHtml template file

texts:
I have been asked to make a seemingly simple change to a magento product page but I am having trouble tracking down the file.

The file template/catalog/product/view.phtml contains the line

echo $this->getChildHtml('product_additional_data')

I want to change the child html (or at least see it to find out if it is the file I'm after) but I can't find where it's coming from.

I have looked at the catalog.xml file and it contains the following block:

<block type="catalog/product_view_additional" name="product.info.additional" as="product_additional_data" />

Should it not have a template="something.phtml" attribute to tell me where to go?

It displays (I think) a table with tabs for "Product Description", "Additional Information" and "Product's Reviews".

Thanks


texts: PayFlow (Direct) setting orders to On Hold

texts:
We've been using PayFlow Pro Direct Payments on our 1.4.0.1 site for several years. All of a sudden we've been getting all orders placed through there with a status of "On Hold" and this message on the order:
Payflow PNREF: #999999999999. Amount of $99.99 pending approval on gateway.

This is how I have it setup:

What is wrong?

Note, please don't tell me to upgrade, this install was done by contractors that severely customized it by not following standard principles, mainly by editing core source, and so we will not be able to upgrade. This installation is also tightly coupled with an ExpressionEngine CMS and later versions of Magento do not work well with it.


texts: Changing column width in grid view for a category using Custom Layout Update

texts:
So most of my categories use 3 columns in grid view on category pages. But I have a couple I only show 2 columns and my hope is is to allow for larger product images just for a certain category. Not for every category.

I used a Custom Layout update in the category (see below) to change the number of columns. Is there a way to change the width of the columns also using a Custom Layout update?

<reference name="product_list">
    <action method="setColumnCount"><columns>2</columns></action>
 </reference>

Thanks


texts: PayPal advanced error message "Payment has been declined. Please try again"

texts:
I am using PayPal advanced. Everything as far as paypal integration is concerned is working fine. Payment goes through the gateway and funds are transferred. However, when any transaction with a credit card is used, I get this pop-up error message "Payment has been declined. Please try again". I have tried everything I can find via all magento forums.

Please help! This is driving me insane.


texts: magento 2 images on category page not visible

texts:
If I import products with csv the image is not visibly at the category page. If I go to the product page the image is showing. How is that possible.
base, thumbnail, small image and swatch are fine.

I use magento 2.1.6


texts: Magento : Quick View Add to Cart not Showing Product in Minicart Witout Refreshing Page

texts:
I am using custom quick view with ajax. When I add product in cart using this quick view, mini cart show count of product but its not show product there. After refreshing page product show in minicart.

Here is my code used to Ajax add to cart function.

     function addtoCart(miniurl){
        var miniurl=miniurl;
        jQuery("#success_message").show();
        jQuery("#success_message").html('<img src="/demo/media/images/loading-round.gif" alt="Loading..." width="77" height="73">');
        var url;
        url = jQuery('#product_addtocart_form').attr('action');

        url = url.replace("checkout/cart", "ajax/index"); // New Code
        if ('https:' == document.location.protocol) {
            url = url.replace('http:', 'https:');
        }
        var data = jQuery('#product_addtocart_form').serialize();
            data += '&isAjax=1';
        try {
            jQuery.ajax({
                url:url,
                dataType:'json',
                type:'post',
                data:data,
                success:function (data) {
                    if(data.status=="SUCCESS"){
                jQuery("#success_message").html(data.message);
                 minicartAjax(miniurl);
                 var qty = jQuery("#qty").val();
                 var curqty = jQuery(".header-minicart .count").html();
                 var newqty=parseInt(qty)+parseInt(curqty);
                 jQuery(".header-minicart .count").html(newqty);
                //jQuery(".header-minicart .label").html('Cart ('+newqty+')');

                    }

                }

            });
        } catch (e) {

        }
    }
    function minicartAjax(url){
    var url = url;
    //alert(url);
    jQuery.ajax({
        url: url,
        dataType: 'json',
        success: function(data){
            var response = data.responseText.evalJSON();
            jQuery(".header-minicart").update(response.minicart);
            //jQuery('#header-cart').html(data.mini_cart);
            alert(response.minicart);
        }
    });
}

Custom controller for add to minicart

app/code/local/Minicart/Quick/controllers/minicartcontroller.php

     <?php
class Minicart_Quick_MinicartController extends Mage_Core_Controller_Front_Action{
    public function add_to_minicartAction()
    {
        Mage::log("control get",null,"mini.log");
        $this->loadLayout();
        $layout = Mage::getSingleton('core/layout');
        $block = $layout->getBlock('cart_sidebar');
        $html = $block->toHtml();
        $this->getResponse()->setBody(Mage::helper('core')->jsonEncode(array('minicart' => $html)));
    }
}

app/code/local/Minicart/Quick/etc/config.xml

    <?xml version="1.0"?>
  <config>
     <modules>
        <Minicart_Quick>
          <version>0.1.0</version>
        </Minicart_Quick>
     </modules>
     <frontend>
       <routers>
          <routeurfrontend>
              <use>standard</use>
              <args>
                 <module>Minicart_Quick</module>
                 <frontName>Quick</frontName>
              </args>
           </routeurfrontend>
       </routers>
    </frontend>
</config>

Here is method that I passed custom controller url to addtocart ajax function

<?php $miniurl = Mage::getUrl('quick/controllers/add_to_minicart');?>
<button type="button" title="Add to Cart" class="button btn-cart" id="addto-cart" onClick="addtoCart('<?php echo $miniurl;?>')">Add to Cart</button>


texts: Magento 2 (CE) not displaying the Checkout page

texts:
I tried to run Magento(CE) 2.1.0 in my localhost but it seems that my checkout page isn't displaying anything, just header and footer.

I am new to magentoif anyone could help that would be great.

This is my checkout page:


texts: Want to install SUPEE-11086 patch for magento 1.9.2.0 version

texts:
I want to install SUPEE-11086 patch  Magento 1.9.2.0 version.

Does anyone have an idea about this?


texts: Zero Subtotal Payment not showing in admin and frontend

texts:
I have activated zero subtotal payment in the configuration. And i have made sure, that it is activated for the shop (I explicitly activated it for the shop, even if it is set active globally).

But it does not show in the backend Manage->Products->(Some Product)->Prices->Disabled Payment Methods

And it is not available during checkout. I edited the getMethods() method from Mage_Payment_Block_Form_Container to log the available payment methods. And the only methods returned are: debit, bankpayment and invoice.

Furthermore i did a diff of the core/Mage/Payment folder with the source of Magento 1.7.0.2 and have found no differences.

Has anyone an idea, what I'm doing wrong?


texts: Updating Configurable price in the database

texts:
I need to update the Price for all configurable products in the database but I am not sure what table or column to use within my query.

I am almost there as I can enter the lowest priced simple product Price for all configurable products in a new table I created but what I need is to update the current price of the configurable products.

require_once('app/Mage.php');
umask(0);
Mage::app();

include 'pathtocredentials.php';
$con = mysqli_connect  ($host, $username, $password, $dbname);

$configurable = Mage::getResourceModel('catalog/product_collection')->addAttributeToFilter('type_id', array('eq' => 'configurable'));

foreach ($configurable as $_configurableproduct) {

    $product = Mage::getModel('catalog/product')->load($_configurableproduct->getId());
    $id = $product->getId();
    $price = $product->getFinalprice();

mysqli_query($con,"UPDATE some_table SET some_column=$price WHERE id=$id";

}

mysqli_close($con);


texts:
We have 2 buttons in Product view page, after we click on 1st button, we are creating Product Programtaically.

once click on 2nd button [ after entering email, password] we are assigning the product to that customer.

Here issue is we are creating product immediately after click on 1st button, but we need to save the product in session and nwe want to create that product after user click on 2nd button.

protected function _createProduct($type, $doSave = true, $originalProduct, $newImagePath = "")
    {

        Mage::register('isSecureArea', true);
        $session = Mage::getSingleton('customer/session');

        $result = array(
            'success' => false
        );

        $login = "";
        $productId = "";
        if ($this->getRequest()->isPost()) {
            $login = $this->getRequest()->getPost('login');
            $productId = $this->getRequest()->getPost('product_id');
        }

        try {
            if (isset($login) && (is_array($login) && !empty($login)) || ($login != "")) {
                $designId = Mage::getSingleton('core/session')->getData('mydesign_id');
                $session->login($login['username'], $login['password']);
                $result['redirect'] = $this->_getRefererUrl() ? $this->_getRefererUrl() : Mage::getUrl('customer/account', array(
                    '_secure' => true
                ));
                $result['success'] = true;
                $customerId = Mage::getSingleton('customer/session')->getCustomerId();
                $model = Mage::getModel('example/mydesign')->load($designId);
                if ($model->getId()) {
                    $model->setData('customer_id',$customerId);
                    $model->save();
                }

                Mage::getSingleton('core/session')->unsetData('mydesign_id');
                $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
                return $this;
            } else {
                $customerId = "";
            }

            $product = Mage::getModel('catalog/product');

            $product->setName($originalProduct->getName());

            $customerId = Mage::getSingleton('customer/session')->getCustomerId();
            $product->setCustomUid($customerId);

            if ($doSave) {
            }
            $product->save();

            $fav1_id = '';
            $data = array(
                'title' => $fav1_id,
                'product_id' => $product->getId(),
                'customer_id' => $customerId

            );
            //echo '<pre/>';
            $model = Mage::getModel('example/mydesign')->setData($data);
            try {
                $fav1_id = $model->save()->getId();
                if (!$customerId) {
                    Mage::getSingleton('core/session')->setData('mydesign_id', $fav1_id);
                }

            } catch (Exception $e) {
                echo $e->getMessage();
            }
            // To save

            return $product;

        } catch (Mage_Core_Exception $e) {
            switch ($e->getCode()) {
                case Mage_Customer_Model_Customer::EXCEPTION_EMAIL_NOT_CONFIRMED:
                    $message = Mage::helper('customer')->__('This account');
                    break;
                default:
                    $message = $e->getMessage();
            }
            $result['error'] = $message;
            $session->setUsername($login['username']);

        } catch (Exception $e) {
            $result = "ERROR :" . $e->getMessage();

        }

        Mage::unregister('isSecureArea');
        $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));

    }


texts: What is the best way to create "recursive template"?

texts: How could one make a template that based on some condition renders itself again?


texts:
I have found a lot of posts asking this question but I haven't found any answers that work for my website.

I would like to remove the "ACCOUNT" link at the top-right corner of the page.
I am running Magento 1.9.2.1 and using the RWD theme.

I have tried removing the link in a local.xml file:

<default>
     <reference name="top.links">
         <action method="removeLinkByUrl"><url helper="customer/getAccountUrl"/></action>
     </reference>
</default>

I have tried disabling all the modules that Amit recommends here: How to remove ACCOUNT and CART from website?

I'm able to change the wording by using the Translate Inline tool but I can't remove it entirely (unless I switch to the default theme, it's not displayed then).

Furthermore, all the files I've gone through that add the link say "My Account" and in my website it says "ACCOUNT" so this leads me to believe I'm not editing the correct files.

How do I remove the link?


texts:
We have Magento CE 1.9.1.0.
During the new 7405 patch install, we got some patch errors:

patching file app/code/core/Mage/Admin/Model/Observer.php
Hunk #2 FAILED at 43.
Hunk #3 succeeded at 68 with fuzz 2.
1 out of 3 hunks FAILED -- saving rejects to file app/code/core/Mage/Admin/Model/Observer.php.rej
patching file app/code/core/Mage/Admin/Model/Redirectpolicy.php
patching file app/code/core/Mage/Admin/Model/Resource/User.php
patching file app/code/core/Mage/Admin/Model/User.php
patching file app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/History.php
patching file app/code/core/Mage/Adminhtml/Block/Widget/Grid.php
patching file app/code/core/Mage/Adminhtml/Helper/Catalog/Product/Edit/Action/Attribute.php
patching file app/code/core/Mage/Adminhtml/Helper/Sales.php
Hunk #1 FAILED at 120.
1 out of 1 hunk FAILED -- saving rejects to file app/code/core/Mage/Adminhtml/Helper/Sales.php.rej
patching file app/code/core/Mage/Adminhtml/Model/System/Config/Backend/File.php
patching file app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Image.php
patching file app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Image/Favicon.php

What can I do to help resolve this? Any ideas?


texts: CE 1.9.1 special price from and to dates populating by themselves!

texts:
So, all my products are showing in front end at their sale prices. In the back end there are saved start and end dates in the product/prices screen.
Clearing the start and end dates for the special prices of individual products does not work: upon save either the from date or both from and to dates are filled again. If the from date is filled, it is today's date, if the to date is filled, often it is ten years in the future. I can set the from date to a future date and that saves OK.
I hear I should not be using phpmyadmin to edit tables directly so I hope there is another, safe method. Helps!


texts: Create store programmaticaly after deleting it the wrong way

texts:
I've created a store using this code.
/**
 * @param $groupId
 * @param $websiteId
 * @param $storeName
 * @param $storeCode
 * @return Group
 * @throws Exception
 */
private function createOrUpdateGroup($groupId, $websiteId, $storeName, $storeCode)
{
    $group = $this->groupFactory->create();
    if($groupId){
        $group->load($groupId);
    }
    $group->setWebsiteId($websiteId);
    $group->setName($storeName);
    $group->setCode($storeCode);
    $group->setDefaultStoreId(2);
    $group->save();

    return $group;
}

/**
 * @param $group
 * @param $websiteId
 * @param $storeViewName
 * @param $storeViewCode
 * @param $data
 * @return Store
 * @throws LocalizedException
 */
private function createOrUpdateStore($group, $websiteId, $storeViewName, $storeViewCode, $data)
{
    $store = $this->storeFactory->create();
    if($group->getId() && $group->getDefaultStoreId()){
        $store->load($group->getDefaultStoreId());
    }

    $store->setName($storeViewName . ' - Store View');
    $store->setCode($storeViewCode);
    $store->setWebsiteId($websiteId);
    $store->setGroupId($group->getId());
    $store->setSortOrder($data['sort_order']);
    $store->setIsActive($data['is_active']);
    $store->save();

    return $store;
}

But as some information were missing I deleted this store in the database going in the tables store / store_group , but it looks like I forgot some datas that might be generated under the hood, so now when I try to create the create the store again, I'm getting this error :

Installing schema... SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'stores-2-web/unsecure/base_url' for key 'CORE_CONFIG_DATA_SCOPE_SCOPE_ID_PATH', query was: INSERT INTO core_config_data (scope, scope_id, path, value) VALUES (?, ?, ?, ?)

I can't find this stores-2-web in my table, so my question is :
Is there a way I can see the final full sql request in order to be able to delete the row which seems to be already existing ? Oy much better, do you know what I need to delete to really purge these dead datas ?


texts: Customer is active even after session deleted

texts:
I have a simple service, SOAP API, to log out customer based on his email ID.

This service is getting parameter properly and even the respective user session is deleted. I have confirmed this using the system logs.

But the issue is Customer is still not logged out from the system.

Can someone please help, since I am newbie in Magento.


texts: Products are disappearing from categories and are coming back when we flush the cache

texts:
On Magento 2.2.7, all the products are disappearing from some of its categories so that PLP becomes blank. When we clear FPC, the products are coming back.

This issue happens at least once every day and as said above, it gets resolved when we clear FPC

Can anyone help me to solve this issue, Thanks in advance..!


texts: How to get Session CUSTOMER ID outside Magento

texts:
Hereby, I working in  PHP  Outside Magento Folder.Here I need to get Session values like Customer ID into Outside Magento.Here I working this sample code in outside Magento.

<?php
// Your Magento Mage.php
// Mage Enabler WordPress plugin users may
// skip line numbers 5, 6 and 7
require_once ("/var/www/magento_pack/app/Mage.php");
umask(0);
Mage::app("default");
#Mage::setIsDeveloperMode(true);
#ini_set('display_errors', 1);
umask(0);
Mage::app()->loadArea('frontend');

$layout = Mage::getSingleton('core/layout');

//load default xml layout handle and generate blocks
$layout->getUpdate()->load('default');
$layout->generateXml()->generateBlocks();

//get the loaded head and header blocks and output
$headBlock = $layout->getBlock('head');
$headerBlock = $layout->getBlock('header');
$footerBlock = $layout->getBlock('footer');
// echo $headBlock->toHtml() . $headerBlock->toHtml().$footerBlock->toHtml();
Mage::getSingleton('core/session', array('name' => 'frontend'));
if(Mage::getSingleton('customer/session')->isLoggedIn())
  echo Mage::getSingleton('customer/session')->getId();
else
  echo 'Not logged in';
  exit;

But Doesnt show proper customers details.How to achieve outside magento session value exactly customer details.Kindly Advise me...


texts: What is setSendCconfirmation user for in create order function

texts:
Sorry for my silly question:

I have followed this question to create new orders by code and it worked but i don't know what is setSendCconfirmation function usage for. I tried to search setSendCconfirmation in Magento core but no result.


texts: Need SEO help with our sitemap.xml Google Index rate

texts:
We have a Magento multi-store setup for 3 stores/domains built on October, 2013. Since then we have great google sitemap.xml index rates for over 90% across all 3 domains. On 2/25/2014, we added another domain into the same magento installation. The sitemap.xml index rate for the original 3 domains dropped significantly afterward.(Our mistake to include every single SKUs we have into the 4th domain) After we discovered the problem, we took out the 4th domain and changed everyting back to before. We waited for couple weeks, 2 of the websites are back on track on sitemap.xml with 90% index rate. For the other domain, we tried everything we could to increase the index rate without any luck. It's been over one month after we took out the 4th domain, somehow Google only indexed 1% of the sitemap.xml and kept the rate since.

Our configurations:

Magento Configurations are the same across all 3 stores/domains
All 3 domains using different IP addresses. (We implemented this after the big drop on index rate)
3 websites share some of the products and brands we carry
All 3 domains shares same .htaccess and robot.txt
All of our domains are more than 5 years old.
We use Nexcess for Magento hosting. (Updated for reference.)

Question:
What else might causing google to not index the 3rd domain's sitemap.xml?

FYI: We are able to manually submit urls in webmaster tools for google to index it.


texts: Parameter type seems to be wrong type in preference

texts:
I made this two preferences
<preference for="Magento\Catalog\Block\Product\ProductList\Toolbar" type="Prj\Catalog\Block\Product\ProductList\Toolbar" />
<preference for="Magento\CatalogSearch\Model\ResourceModel\Fulltext\Collection" type="Prj\Catalog\Model\ResourceModel\Fulltext\Collection" />

In Toolbar.php; there is a method
setCollection($collection){...}

in my custom Toolbar, I specified the collection type to be Prj\Catalog\Model\ResourceModel\Fulltext\Collection
like that
use Prj\Catalog\Model\ResourceModel\Fulltext\Collection;
/**
 * @param Collection $collection
 * @return $this|Toolbar
 * @throws \Magento\Framework\Exception\NoSuchEntityException
 */
public function setCollection($collection){...}

But the issue is that the interceptor generated for the collection keeps having the original type Magento\CatalogSearch\Model\ResourceModel\Fulltext\Collection\Interceptor instead of the one I am expecting that would be the one from the preference...meaning I can't access all the custom I made in the Collection preference.
I can't understand what I am doing wrong
This is my Collection custom.
namespace Prj\Catalog\Model\ResourceModel\Fulltext;

class Collection extends \Magento\CatalogSearch\Model\ResourceModel\Fulltext\Collection {...}


texts: How to tell if a customer has created a password, or never logged in?

texts:
For one of our site features, we create customer records programmatically using the customer's email and other information (address, first & last names, etc.) - the customer then just resets their password when they need to log in.

From what I can tell, Magento is generating a random encrypted password to use as a placeholder for the customer's password when the record is created. Is there a built in way to tell if a customer has created a password (or has never logged in)?


texts: Call $_product from outside product view

texts:
I'm trying to display products with same attribute in product view. I had my code in view.phtml and now i want to remove it and calling it using getChildHtml() function.
my block definition :

<block type="catalog/product_view" name="product.info.samecollection" as="same_collection_products" template="catalog/product/list/samecollection.phtml">
                </block>

my same_collection.phtml:

 <?php $_product = Mage::getModel('catalog/product')->load();
  $col = Mage::getModel('catalog/product')->getCollection()->addAttributeToSelect('*')->addAttributeToFilter('collection_titelive',array('like'=>$_product->getCollectionTitelive()))->load();
    ?>
  <?php foreach($col as $same_col){
     $same_col = Mage::getModel('catalog/product')->load($same_col->getId());
    ?>
  <a href="<?php echo $same_col->getProductUrl();?>"><img alt="<?php echo $same_col->getName();?>" src="<?php echo $same_col->getImageUrl();?>"  height="125" width="125">
    <?php }?>

In my view.phtml, i have:

 <?php echo $this->getChildHtml('same_collection_products')?>

I would like to note that i tested the block with simple html and it was displayed and that first method of fetching products from product view also dispalyed the correct items.

I'm relatively new to magento so if you have any insights.

Thank you in advance.


texts:
I know this is a common issue, but cant seem to find a proper answer anywhere.
I am running a Magento 2.3.3 shop and have my product imported through a plugin and these are imported excluding tax (i cannot change this, my industry suppliers work on excluding tax and this is how the prices are imported).
No matter what tax settings i use the inc VAT prices are always wrong when added to the cart.
For example, i have a product that sells for £8 inc VAT, so the ex VAT price set in the catalog is £6.67.   The catalog and product pages display this correct at £8, but when a quantity of 2 is added to that cart it shows at £8.01 each.
I had an order yesterday for:
2 x £8
2 x 17 (these show as £17.01 in the cart)
£5 delivery
Magento works this out at £55.02, not £55. Before tax it displays as £45.85, not £45.83 like it should be.
No customers have yet questioned it, but it is frustrating and only a matter of time until somebody does.
My current tax settings are:
Tax Calculation Method Based On: Total (Have tried unit and row and i would prefer unit)
Catalog Prices: Excluding Tax (has to be this way)
Shipping Prices: Excluding Tax
Discounts are a whole other ball game and dont seem to be ale to do calculate discount after and including tax but this is not my worry for now.
I would like to figure out how i can display, in this example the prices correct with a total of £55 inc VAT. I know this is a rounding issue but dont know how to solve it.
Thanks


texts:
How to save value  for a Specific[custom] Product Attribute from Product Model ?

I have found the below script from here :

$product = Mage::getModel('catalog/product')->load(1);

$product->setName('Some Random Name');

$product->getResource()->saveAttribute($product, 'name');


texts: How to get collection of orders which can be shipped?

texts:
I need orders which are not shipped yet or are partially shipped. I am using below code to get orders which can be shipped.

foreach ($orderIds as $orderId) {
    $order = Mage::getModel('sales/order')->load($orderId);
    if ($order->canShip()) {
        echo "Shipping Pending";
    }
}

But I don't want to use foreach. I need something like below.

Mage::getModel('sales/order')->getCollection()
    ->addFieldToFilter('status','can_ship');


texts: Tab for Push Ahead/Highlight product in Admin grid in Catalog/Category

texts:
I have a problem, i have create a new tab to manage Push Ahead/Highlight product for each category.

But, i want to display all the product Push Ahead/Highlight and when i unChecked the Checkbox on the left and i save the product is no longer push ahead/highlited.

The problem is with JS/Php i don't find a way to do that with magento...

Can someone have an idea ?

Here my JS :

`
        <input type="hidden" name="push_ahead" id="PushAheadProducts" value="" />
<script type="text/javascript">
//<![CDATA[

<?php if(($block = $this->getLayout()->getBlock('category.product.grid')) && ($_gridJsObject=$block->getJsObjectName())): ?>

    var pushProducts = $H(<?php echo $this->getProductsJson() ?>);
    $('PushAheadProducts').value = pushProducts.toQueryString();

    function registerCategoryProduct(grid, element, checked){
        if(checked){
            if(element.positionElement){
//                            console.log("here");
                element.positionElement.disabled = false;
                pushProducts.set(element.value, element.positionElement.value);
            }
        }
        else{
            if(element.positionElement){
                element.positionElement.disabled = true;
            }
            pushProducts.unset(element.value);
        }
        $('PushAheadProducts').value = pushProducts.toQueryString();
        grid.reloadParams = {'selected_products[]':pushProducts.keys()};
    }
    function categoryProductRowClick(grid, event){
//                    console.log("here");
        var trElement = Event.findElement(event, 'tr');
        var isInput   = Event.element(event).tagName == 'INPUT';
        if(trElement){
//                        console.log("here");
            var checkbox = Element.getElementsBySelector(trElement, 'input');
            if(checkbox[0]){
                var checked = isInput ? checkbox[0].checked : !checkbox[0].checked;
                <?php echo $_gridJsObject ?>.setCheckboxChecked(checkbox[0], checked);
            }
        }
    }
    function positionChange(event){
//        console.log("here");
        var element = Event.element(event);
        if(element && element.checkboxElement && element.checkboxElement.checked){
            pushProducts.set(element.checkboxElement.value, element.value);
            $('PushAheadProducts').value = '0';
        }
    }

    var tabIndex = 1000;
    function categoryProductRowInit(grid, row){
        var checkbox = $(row).getElementsByClassName('checkbox')[0];
        var position = $(row).getElementsByClassName('input-text')[0];
        if(checkbox && position){
//            console.log("here");
            checkbox.positionElement = position;
            position.checkboxElement = checkbox;
            position.disabled = !checkbox.checked;
            position.tabIndex = tabIndex++;
            Event.observe(position,'keyup',positionChange);
        }
    }

    <?php echo $_gridJsObject ?>.rowClickCallback = categoryProductRowClick;
    <?php echo $_gridJsObject ?>.initRowCallback = categoryProductRowInit;
    <?php echo $_gridJsObject ?>.checkboxCheckCallback = registerCategoryProduct;
    <?php echo $_gridJsObject ?>.rows.each(function(row){categoryProductRowInit(<?php echo $_gridJsObject ?>, row)});

<?php endif; ?>
//]]>
</script>
`


texts: How can I add a block to the order page in the Back Office?

texts:
I just recently started learning Magento, so do not judge me asking a stupid question.

I read the documentation and do everything step by step. Now I got to the last point (Step 4) and I can not do it. I do not understand in what directory to place the files described in step 4. Can you help? Thank.

Please, I'm just learning.


texts:
I want to force some block to be a child, so setchild() doesn't work !

<catalog_product_view>
    <reference name="root">
        <block type="type/block" name="grid" as="grid" template="path_to.phtml">
            <action method="setChild"><child>grid</child><alias>grid</alias></action>
        </block>
    </reference>
</catalog_product_view>

<?php echo $this->getChildHtml('grid');?> // doesn't work


texts: Magento 2 - display "Not display individually" product on listing page

texts: I want to display "Not display individually" visibility product display on listing page. Please help and thanks in advance


texts: How I can create New State and Status programmatically in the Magento 2?

texts:
$orderId = $orderIds[0];
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$order = $objectManager->create('\Magento\Sales\Model\Order') ->load($orderId);
$order->setState(\Magento\Sales\Model\Order::STATE_COMPLETE, true);
$order->setStatus(\Magento\Sales\Model\Order::awaiting_stock );
$order->addStatusToHistory($order->getStatus(), 'Awaiting Stock');
$order->save();

This is my code and I want to set there custom status. How can I set there custom status?


texts: Create Custom Tab into Magento 1.9 Admin Panel

texts:
This Problem is related to Backend side (Magento 1.9 Admin panel) not for Frontend side:

Part: 1)
- I wanna Create Custom tab (suppose 'CategoriesInfo') in magento 1.9 admin panel. (like parallel to other top side tabs like, Dashboard,Sales,Category,CMS and etc )
- This tab has one sub_tab, 'categoryIDs'
- When you click on 'categoryIDs' sub_tab, it'll show one page at admin panel where i can write my logic to fetch all available categories.

Part: 2)
- It will show all the Catagories and sub_categories IDs and Categories name with Checkboxs.
- Admin can select any category then click on save button then data should be save into file/DB (for now in file).

Please Share Your ideas, Your ideas and efforts are appreciable for me, Thanks.


texts:
I am trying to optimise Database and Code because some time its going not well, I saved session in database so when database size are increase My site performance is also bad.

Also I need to handle 2500 concurrent user on site. current it work well up to 300-400


texts: Add to cart not working for configurable products on product listing page. Magento - 2

texts:
The add to cart function is not working for configurable products on product listing page.

When selecting the configurable product options(color,size) of the product and then trying to add the product to the cart, the cart is not updating and instead I'm redirected to the product detail page.

The configurable products need to be added to the cart when on the product listing page rather than redirecting to the product detail page.

There are no errors in the console and the Network tab is also showing no errors.

After redirecting to product detail page a message appears on top that you need to select options for your item.I have already chosen the required options.

Thanks in advance.


texts: Get Category URL multistore and multisite

texts:
I have a 2 website.

https://website.com (Default Website)
https://site.website.com (Secondary Website)

Now I'm accessing the admin panel using the https://website.com/admin/catalog/category... Now when I save the categories I have an observer that generate the menu for each of this site. Take note that each website is using different root category. Upon clicking the save category button it generate an html file which contains the list of categories for each website. But the problem now is when I checked the generated url for https://site.website.com/ it generates a category url of https://website.com/secondsitecategory which I expect should be https://site.website.com/secondsitecategory.

Below is my code to retrieve the category in Magento 2

$subcategories = $category->getCollection()
            ->addAttributeToSelect('*')
            ->setStoreId($store->getId())
            ->addAttributeToSort('position', 'ASC')
            ->addIdFilter($category->getChildren())
            ->load();

Note: the $category in $category->collection() is the root category of every website. I tried using emulator like

  $this->_emulator->startEnvironmentEmulation($store->getId(), \Magento\Framework\App\Area::AREA_FRONTEND, true);

before every $category->getCollection() but it's not working. Would any one of you have an idea on how to solve this?


texts:
It looks as though the css is not loading on secure pages. In the checkout the CSS is not loaded (fonts are changing). We are using cdn and I tried changing the media url for secure pages to the cdn url but nothing changed.

Any ideas?


texts: Magento pagination not working with custom objects

texts:
I am trying to applying magento pagination on custom object but not able to do it properly. Problem is my object is not an db object, I am calling an API which returns data in json format. I am converting the data into array first and then trying to convert that array into collection object. The pager calculates the page numbers correctly. It seems like it is not able to apply limits on the collection. All the items show on all the pages. This is how i am doing it -

$collection = new Varien_Data_Collection();
foreach($order['data']['orderlist'] as $row){
    $rowObj = new Varien_Object();
    $rowObj->setData($row);
    $collection->addItem($rowObj);
}

Please let me know how can i apply the limits correctly on each page. Any help would be much appreciated.


texts: How to create Dynamic url rewrite in magento with config.xml

texts:
I need to rewrite my url.
my current url is below.

http://example.com/milano_theme/magazine/index/archive

http://example.com/milano_theme/magazine/index/show

http://example.com/milano_theme/magazine/index/showarchive/o/1

these are my urls.

i want to replace to be like this

http://example.com/milano_theme/magazine_archive.html

http://example.com/milano_theme/magazine_show.html

http://example.com/milano_theme/magazine_showarchive_o_1.html

i created rewrite in my magento config.xml

<rewrite>
    <archiveshow>
       <from><![CDATA[#^/archiveshow/#]]></from>
        <to><![CDATA[/magazine/index/showArchive/o/]]></to>
        <complete>1</complete>
    </archiveshow>

    <magazine>
       <from><![CDATA[#^/magazine[\/]?$#]]></from>
     <to><![CDATA[/magazine/index/show/$1]]></to>
        <complete>1</complete>
    </magazine>

    <archive>
       <from><![CDATA[#^/archive[\/]?$#]]></from>
     <to><![CDATA[/magazine/index/archive/$1]]></to>
        <complete>1</complete>
    </archive>

</rewrite>

I know it's possible through admin.
but i want to change this by config.xml

how can i do this?


texts: how to set up a virtual server to set up multiple website in xampp locally?

texts:
I wanted to try creating multiple stores and storeview. I am following this tutorial
http://devdocs.magento.com/guides/v2.0/config-guide/multi-site/ms_websites.html
They have asked me to create a virtual host! how should I do this?


texts: How to update product image positions with csv?

texts:
i have bulk number of product with images whose Base Image needs to be changed. I have SKU file in a CSV format.

How can I update the Base Image of a product, any CSV or db query for this ?


texts: magento2 toolbar.phtml issue-not overriding

texts:
Guys I'm stuck in the below issue for overriding core template file.

I'm trying to override default Magento search engine.
I want to override core filter.phtml and toolbar.phtml

I get the products rendered into the frontpage, but my custom templates are not being used.

I get something like this:

I have to get these("Items", "Sort By", "Shipping Options") from toolbar.phtml which i'm not getting

Vendor\Module\view\frontend\layout\catalogsearch_result_index.xml

<?xml version="1.0"?>
 <referenceBlock name="catalogsearch.leftnav">
   <action method="setTemplate">
    <argument name="template" xsi:type="string">Vendor_Module::product/list/toolbar.phtml</argument>
   </action>
 </referenceBlock>

toolbar.phtml
Is same code as core.

I doubt the block name in my xml, please suggest


texts: Order basket, does not choose the delivery method, magento 2

texts: When we are in the basket, and we have filled in all the data and we want to choose the delivery method, then when we click on it, it will be selected and immediately reset, and then it will have to be pressed again a couple of times. What could be such a bug? Why he resets several times the selected delivery method. And this happens only when we first go to the cart, then from the first time, it chooses the delivery method.


texts: Mage::getBaseUrl('media') inside setup file returns only "/"

texts:
When extension is installed first time, it returns proper url with domain included. But if I try to run extension setup script again (by deleting row in core_resource table) it return just "/". And for Mage::getBaseUrl() return "index.php".

Inside mysql4-upgrade-1.1.3-1.1.4.php:

$installer = $this;
$mediaPath = Mage::getBaseUrl('media');
var_dump($mediaPath());
var_dump(Mage::getBaseUrl()); exit;

Am I forgetting something? Is there any other way to get media url with domain included?


texts: In Magento 1.9.2.4 Invoice and Shipping Emails are not working

texts:
I have recently upgraded to Magento 1.9.2.4. After upgrade, the invoice and ship emails are not working from the admin console. Clicking on 'Submit Invoice' (with 'Email copy of invoice' checked) takes to a blank 500 page.

After debugging, it seems that

  $mailer->send()
  method is causing the issue. The method is not returning. The method is present in code/core/Mage/Sales/Model/Order/Invoice.php.

Any clue on what could be the issue ?


texts: How to create pull request to Magento CE 1.9?

texts:
I found bug in core module and want create pull request with fix, but didn't find how I can do that.

How can I do that?


texts: Add Language translation text in magento2

texts: I have added the new field in Customer navigation section near the Sign In, For that new field I need to fr_FR translation where I need to add the translation text? Those translation files are working from which file please tell me.


texts: Magento-2 : How to make customer email as optional to login

texts:
I have custom extension, customer can login by mobile number with OTP, no need to email field as required to login.

I want to make an email address as optional.

How can I make an email address as optional?

Please suggest to me to achieve this requirement.


texts: Item not deleting from quote in Magento2

texts:
I have used observer to delete the quote item.

Used this event controller_action_predispatch_checkout_index_index

This is the code of my etc/events.xml.

<event name="controller_action_predispatch_checkout_index_index">
    <observer name="change_quote_item_price" instance="Vendor\Module\Observer\DeleteItem" />
</event>

Then Vendor\Module\Observer\DeleteItem.php

<?php
namespace Vendor\Module\Observer;
use \Magento\Framework\Event\Observer;
use Magento\Framework\Event\ObserverInterface;
use Magento\Framework\App\Response\Http as ResponseHttp;

class DeleteItem implements ObserverInterface{
  private $logger;
  protected $_messageManager;
  protected $_resource;
  protected $checkoutSession;
  protected $redirect;
  protected $cart;
  public function __construct(
    \Magento\Framework\Message\ManagerInterface $messageManager,
    \Psr\Log\LoggerInterface $logger,
    \Magento\Framework\ObjectManagerInterface $objectManager,
    \Magento\Framework\App\ResourceConnection $resource,
    \Magento\Checkout\Model\Session $checkoutSession,
    \Magento\Framework\App\Response\RedirectInterface $redirect,
    \Magento\Checkout\Model\Cart $cart
  ){
    this->_messageManager = $messageManager;
    $this->logger = $logger;
    $this->_resource = $resource;
    $this->checkoutSession = $checkoutSession;
    $this->redirect = $redirect;
   $this->cart = $cart;
 }
  public function execute(\Magento\Framework\Event\Observer $observer){

    try{
      $quote = $this->checkoutSession->getQuote();
            $quoteItems = $this->checkoutSession->getQuote()->getAllVisibleItems();
            $isExist= false;
            foreach($quoteItems as $item) {
                    $productSku = $item->getSku();
                    $itemId = $item->getItemId();

                    $checkTable  = $this->checkProduct($productSku);
                    if($checkTable ){
                        $isExist= true;
                        $this->cart->removeItem($itemId)->save();
                        continue;
                    }
                    $item->setQty(1);
                    $item->save();
            }
            $quote->collectTotals();

            $message = "You can't buy this product!!";
            if($isExist){
                $this->_messageManager->addError(__($message));
                $controller = $observer->getControllerAction();
                $this->redirect->redirect($controller->getResponse(), 'checkout');
            }

    }catch (\Exception $e) {
        $this->logger->info(' --CheckoutBeforeException--  '.$e->getMessage());
    }
  }

 public function checkProduct($productSku){
   $connection = $this->getConnection();
   $sql = "select * from custom_table where sku='".$productSku."'";
   $resultProduct = $connection->query($sql);
   $resultQuery = $resultProduct->fetchAll();

   if(!empty($resultQuery)){
     $parent_sku = $resultQuery[0]['parent_sku'];
     return true;
   }
  }else{
    return false;
   }
  }

 public function getConnection(){
    $connection = $this->_resource->getConnection(\Magento\Framework\App\ResourceConnection::DEFAULT_CONNECTION);
    return $connection;

  }

 }

This is not deleting the item, actually my observer file is firing. Item not deleting completely.

If navigated to cart page it is showing as summary with subtotal 0. Then in minicart also with qty 1.

Is any other code i need to use to delete the product from quote from itemId? Please anybody look into it and update me your answers. Thanks!!


texts: Magento:2.3.2: Add to cart is not working after element moved

texts:
I tried to move an element to above add-to-cart block at category page.

Please check the following attachments.

I need as the following:

For product availability, I am using an extension. The name of that plugin for the element is mageArray.checkDelivery.

I used the following at my layout default.xml file as follows:

<move element="product.info.addtocart" destination="product.info.main" after="mageArray.checkDelivery"/>

**I tried the above code to change the position of the product availability block. **

Then I get the layout of add to cart and pin availability as per my requirement.

But, from now, add to cart is not working.

My website : https://www.depoto.com/taparia-mh200-machinist-hammers-with-handle.html


texts: To calculate shipping charge after discount is applied

texts:
I need to calculate shipping charge after discount is applied on cart subtotal

for example
cart subtotal: $170.00
Discount: -$15.00
Shipping: $17.00

Here i want it to calculate shipping charges after discount is added to cart subtotal,

for example
cart subtotal: $170.00
    Discount: -$15.00
    Shipping: $15.50

because it should first remove $15 from $170 and then it should calculate shipping charges from the remaining one.

Can you anyone please tell me the way to do this or any workaround for it

thanks in advance


texts:
when i change Price Display Setting in configuration->Tax
including and excluding Tax both in Display Product Prices In Catalog & Display Shipping Prices. following warning appears

  Warning tax configuration can result in rounding errors . Please see source for more details.Click here to go to Tax configuration and change your settings.

i try my level best but not sure why is this, and its effect on tax and calculations

thanks


texts: Magento 1.9 https ERR_TOO_MANY_REDIRECTS

texts:
Could you please help us with the following?

We have some problems while trying to activate SSL on this site.

Certificates are correctly installed (verified with subdir).

If we set url configs as default, the page loads only html because magento tries to load css and js as mixed content(http).

Console errors:

  Mixed Content: The page at 'https//clubmedico.mx/' was loaded over
  HTTPS, but requested an insecure stylesheet
  'http://clubmedico.mx/skin/frontend/tm_themes/theme341k/css/module/aw_blog.css'.
  This request has been blocked; the content must be served over HTTPS.

.

If we set web/unsecure/base_js_url, media and css pointing to  {{secure_base_url}}js/(media and css respectively) instead {{unsecure_base_url}} the page loads almost completely, except many <a>links wich are still pointing to http:.

Also "admin page" and "checkout page" throws ERR_TOO_MANY_REDIRECTS error.

This is the configuration with less errors we can get so far:

We really appreciate any help you can provide.


texts: How to redirect logout page to an extern url

texts:
Doing from this way, everything just work fine: module from vendor/costumer-contact/view/frontend/templates/logout.phtml:
from:
        "Magento_Customer/js/logout-redirect": {
            "url": "<?= $block->escapeJs($block->escapeUrl($block->getUrl())) ?>"
        }
    }
}

to this

<?= $block->escapeHtml(__('You have signed out and will go to our homepage in 5 seconds.')) ?>

How to create a custom module for this extension ?
I want to redirect to an external url


texts: Magento 2 Shipping to Multiple Addresses using REST API

texts:
Has anyone tried creating order with multiple shipping addresses using REST API? I can see the option in the admin dashboard to enable such functionality, but I cannot find any documentation if it is or not possible.

To be clear, I'm talking about use cases when part of the order is shipped to address A with shipping method X and the rest of the order is shipped to address B with method Y.

Alternatively, I'd also be interested in use case where we send order to one address, but some products are sent using shipping method A, and the rest of the products are shipped using shipping method B.

Any help would be much appreciated!


texts: remove values from search result in catalog search top search box

texts:
i have tried core/Mage/catalogSearch/Helper/Data.php
and ResultController.php in Controller and Query.php in model but couldn't find code so i can fix it   here is snapshot attached which i have to remove ..


texts: Custom theme breaks Magento admin, fails to register

texts:
The theme is installed on a fresh Magento-2.1.7 with no data. The system is CentOS-7.3 (VPS@godaddy), MySQL-5.6.37, PHP-5.6.31, Nginx-1.10, PHP-FPM runs as nginx:nginx, file system user is in the nginx group, directories are "g+s"-ed.

Installation steps:
switch to developer mode
clean, flush and disable cache, disable js/css merge/minification.
./bin/magento setup:upgrade
./bin/magento index:reindex
./bin/magento cache:clean

Now, the store front page shows up with the Magento's default template, but /admin_****** throws the following exception:

    Exception #0 (Magento\Framework\Exception\FileSystemException): File "/composer.json" cannot be opened Warning!fopen(/composer.json): failed to open stream: No such file or directory
#0 /.../magento2/app/code/TemplateMonster/ThemeUpdater/Model/ThemeData.php(98): Magento\Framework\Filesystem\Driver\File->fileOpen('/composer.json', 'r')
.... 30 lines of the exception trace follow.

Obviously, it is looking for composer.json in the wrong place. The right place is $MAG_ROOT/app/design/frontend/TemplateMonster/theme###/.
Here are the relevant parts of ThemeData.php and what I discovered through some hacking into them.

    protected function getComposerData()
    {
        $path       = $this->getAbsThemePath() . '/composer.json';
/*98*/  $resource   = $this->_fileDriver->fileOpen($path, 'r');
        ...
    }

The culprit is line #98. Obviously, getAbsThemePath() returns empty string instead of the theme's full path. Here it is:

    public function getAbsThemePath()
    {
        $theme = $this->_theme->load($this->getThemeId());
        $result = $this->_componentRegistrar->getPath(ComponentRegistrar::THEME, 'frontend/' . $theme->getThemePath() );

        return $result;
    }

public function getThemeId()
    { // should return 4, but returns ''
        return $this->_scopeConfig->getValue(self::DESIGN_THEME_ID, $this->getScopeType(), $this->getScopeId() );
    }

In getThemeId():
 runtime arguments to getValue are ('design/theme/theme_id', 'default', null), and getThemeId() returns null (or ''). Actual theme_id in the magento_db.theme table is 4, and if I hard-code getThemeId() to return 4, then everything works.
_scopeConfig is injected \Magento\Framework\App\Config\ScopeConfigInterface

Any ideas as to what's going wrong here and how to fix it?

Also, is it worth fighting with it, or should I just get another template from Template Monster (or some other vendor)?

Thank you for your advice.


texts: How to pass store code to custom URL in magento 2

texts:
I would like to add store code to a custom URL in Magento 2.3.0

Actually, I want to pass store code to a custom URL in my custom module based on relevant store order.

Let's take an example:

public function getCustomUrl($orderData) {
    if($this->emailHelper->dynamicUrl()){
        return $this->urlInterface->getUrl($this->emailHelper->dynamicUrl()).'oId/'.$orderData->getIncrementId().'/fId/'.$this->getFollowUpId();
    }else {
        return $this->urlInterface->getUrl('route/controller/index/'.'oId/'.$orderData->getIncrementId().'/fId/'.$this->getFollowUpId());
    }
}

In the above code

$orderData = order object i can get storeId in this object
$this->emailHelper->dynamicUrl() = get custom string from system config
$orderData->getIncrementId() = pass orderId to url params
$this->getFollowUpId() = module custom table ID pass to url params.

Above code, the result is http://example.com/default/seo/oId/000000112/fId/179 where /default/ is store code. I would like to pass /store2Code/ instead of/default/where/store2Code/` is order placed on store 2.

So in short pass store code based on the placed order store.

Note : I have enabled pass store code to URL from system config. so the reason for this store code is showing in URL.

Any help would be appreciated! Thanks.


texts: {{htmlescape var=$order.getCustomerShipping()}} didn't work in Magento 2

texts:
I added

{{htmlescape var=$order.getCustomerShipping()}}

to email template but it didn't work. However, if using

{{var order.getCustomerShipping()}}

it is working, what's different?

My Magento version is 2.1.5.


texts: Change checkout redirection to custom page (2.2.4)

texts:
I've created a custom page where I submit my cart to create an order.

Now, on the checkout/cart page, when I click on the button to go to the payment, I want to go to my custom page.

I try many things (changes into JS, changes into html...) but I did achieved nothing. How can I do that (the proper way ^^) ?


texts: Paypal express payment method in magento 2.1 and it is not showing in frontend

texts:
security header is not valid (# 10002)

Both PayPal and Magento forums indicate that the error is due to errors password and / or key.

Indeed the error exists, but is not in writing. Magento 2 not properly stored credentials, as indicated in the post [here][1].

Whether credentials are erased as if they are changed, the same number of characters always appears.

I tried to erase the credentials, empty the cache and then return them to enter... but nothing.

I searched the table in which to store this data, but the tables related to PayPal:

paypal_billing_agreement, paypal_billing_agreement_order, paypal_cert, paypal_payment_transaction, paypal_settlement_report, paypal_settlement_report_row

None of these tables stores data related credentials Signature API, the table "cert" would store certificates exclusively.

Where credentials are stored PayPal? Is this a bug in Magento?

Also Paypal is not showing in frontend. I dont know what is the problem.


texts: Pre select custom shipping method in extension code

texts:
I created an extension to extend Magento with another shipping method. Actually I used this tutorial to do this. Only difference is that the shipping method only shows up if an item in cart is eligible for this method. So far it works. But now I want to pre select this shipping method. How can I do that? Unfortunately I couldn't find any information about it. The only option I'm seeing right now is to add the logic in the template. But I was wondering if it can't be set in the extenion (app/code/core/Mage/Shipping/Model/Carrier/Flatrate.php) itself.

<?php

class Creativ_Shipping_Model_Carrier_Oneitem_Extended_Flatrate1
extends Mage_Shipping_Model_Carrier_Abstract
implements Mage_Shipping_Model_Carrier_Interface
{
protected $_code = 'extendedflatrate1';
protected $_isFixed = true;

public function collectRates(Mage_Shipping_Model_Rate_Request $request)
{
    if (!$this->getConfigFlag('active')) {
        return false;
    }

    $result = Mage::getModel('shipping/rate_result');

    $items = $request->getAllItems();

    $eligible = false;

    foreach ($items as $item) {
        if ($item->getProduct()->getInsuranceEligible(false)) {
            $eligible = true;
            break;
        }
    }
    if ($eligible) {

        $method = Mage::getModel('shipping/rate_result_method');

        $method->setCarrier('extendedflatrate1');
        $method->setCarrierTitle($this->getConfigData('title'));
        $method->setMethod('oneitemflatrate1');
        $method->setMethodTitle($this->getConfigData('name'));

        $shippingPrice = $this->getConfigData('price');
        $method->setPrice($shippingPrice);
        $method->setCost($shippingPrice);

        $result->append($method);
    }

    return $result;
}

public function getAllowedMethods()
{
    return array('oneitemflatrate1' => $this->getConfigData('name'));
}

}

Thanks for any help!


texts:
I found a not optimized CSS in the body of the home page.
How can I edit directly this code?

Magento CE 2.2.2

http://prntscr.com/n5qggc


texts:
I want to edit the class in the button to buy, on /checkout/cart/, but when I go to the .phtml of that section, all I get is:

 <table id="shopping-cart-totals-table">
        <col />
        <col width="1" />
        <tfoot>
            <?php echo $this->renderTotals('footer'); ?>
        </tfoot>
        <tbody>
            <?php echo $this->renderTotals(); ?>
        </tbody>
    </table>

Where can I find the rendersTotal function?


texts: Magento2: How to move from localhost wamp to live server

texts:
I'm trying to move local magento2 instance to live server. I've moved all the files and database. Changed entries in core_config_data for base_url.
Also, removed var/cache, var/view_processed directories. Set proper permissions for var/ folders. But still I'm getting next error and also the no magento2 commands working on SSH.

  Fatal error: Cannot instantiate interface
  Magento\Store\Api\StoreRepositoryInterface in
  /data/sites/web/hypebe/subsites/deboomhut.hype.be/deboomhut-webshop/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php
  on line 73

Any help would be appreciable. Thanks in advance.


texts:
I want to override the SalesRule model for my custom module, but it already used in another third party module. But the problem is my override is loading always first.

And the third party module's override is stopped because of mine.

So what I have done for solution, added the depends tag in the module declarations.

<codePool>local</codePool>
<depends>
      <RandW_RewardPoint/>
</depends>

In my module config.xml

<salesrule>
    <rewrite>
        <validator>Toy_Gift_Model_Validator</validator>
    </rewrite>
</salesrule>

Third party config.xml

<salesrule>
    <rewrite>
        <validator>RandW_RewardPoint_Model_Validator</validator>
    </rewrite>
</salesrule>

And in my Validator.php

class Toy_Gift_Model_Validator extends RandW_RewardPoint_Model_Validator  {

But its not working as expected, still always working from my module. My idea is both should work. Please give me a solution.


texts: how to set similar custom option for all products once?

texts:
I have many categories like rings, pendents, chains in my site.
the products under category rings have custom option like
Quality grade - A, B, C ....
size          - 5,6,7 .....
metal         - Gold , silver, platinum all with some extra prices

Is there any way to create custom option once for the product and i can use them in all other product under rings.

As now i have to add same options again n again when i add products? Different custom option for different category.

Please suggest


texts: Magento2: How to change order status for COD orders

texts:
Currently

when customer pay order in advance example in paypal I have order status "paid".
when customer try pay for order in advance example via paypal but payment refused I have order status "pending".
But when customer select payment method "Cash on Delivery" I also have order status "pending".

How to set:
When customer select payment method "cash on delivery" then default status order is "COD".


texts: How to get the settings from the toolbar

texts:
Customers can set settings to show products using the toolbar:

But how do I get the selected settings, like what pageSize they want?
EDIT:
Sorry for not being clear enough, I'm trying to get the by te customer selected pageSize in PHP. Because I load the products myself and I want to use the selected amount of products.


texts: An error has happened during application run. See exception log for details. - Going round in circles

texts:
Magento CLI 2.3.3

I get the above error when visiting my homepage, checking the exception log i see this

  main.CRITICAL: Class Magento\Framework\App\Http\Interceptor does not
  exist {"exception":"[object] (ReflectionException(code: -1): Class
  Magento\Framework\App\Http\Interceptor does not exist at
  /home/admin/public_html/vendor/magento/framework/Code/Reader/ClassReader.php:19)"}
  []

After looking for answers I found this which I run

php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:Deploy -f
chmod -R 777 var/ generated/

But now my homepage says

Please upgrade your database: Run bin/magento setup:upgrade from the Magento root directory.
The following modules are outdated:

  Temando_Shipping data: current version - 1.5.0, required version -
  1.6.0

  Vertex_Tax data: current version - 100.3.0, required version - 100.4.0

  Yotpo_Yotpo data: current version - none, required version - 3.0.0

So I run

bin/magento setup:upgrade

and terminal says

SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'origin.address.countryCode' for key 'PRIMARY', query was: INSERT  INTO `temando_product_attribute_mapping` (`node_path_id`,`label`,`description`,`mapping_attribute_id`,`is_default`) VALUES (?, ?, ?, ?, ?), (?, ?, ?, ?, ?), (?, ?, ?, ?, ?), (?, ?, ?, ?, ?), (?, ?, ?, ?, ?), (?, ?, ?, ?, ?)

and my homepage is blank.

If anyone can help me going round in circles with this I would much appreciate it. Thanks

After trying the first 2 answers I check the error report again

{"0":"Please upgrade your database: Run \"bin\/magento setup:upgrade\" from the Magento root directory.\nThe following modules are outdated:\nTemando_Shipping data: current version - none, required version - 1.6.0\nVertex_Tax data: current version - none, required version - 100.4.0\nYotpo_Yotpo data: current version - none, required version - 3.0.0","1":"<pre>#1 Magento\\Framework\\App\\FrontController\\Interceptor->Magento\\Framework\\Interception\\{closure}() called at [vendor\/magento\/module-page-cache\/Model\/App\/FrontController\/BuiltinPlugin.php:73]\n#2 Magento\\PageCache\\Model\\App\\FrontController\\BuiltinPlugin->aroundDispatch() called at [vendor\/magento\/framework\/Interception\/Interceptor.php:135]\n#3 Magento\\Framework\\App\\FrontController\\Interceptor->Magento\\Framework\\Interception\\{closure}() called at [vendor\/magento\/framework\/Interception\/Interceptor.php:153]\n#4 Magento\\Framework\\App\\FrontController\\Interceptor->___callPlugins() called at [generated\/code\/Magento\/Framework\/App\/FrontController\/Interceptor.php:26]\n#5 Magento\\Framework\\App\\FrontController\\Interceptor->dispatch() called at [vendor\/magento\/framework\/App\/Http.php:137]\n#6 Magento\\Framework\\App\\Http->launch() called at [vendor\/magento\/framework\/App\/Bootstrap.php:261]\n#7 Magento\\Framework\\App\\Bootstrap->run() called at [index.php:39]\n<\/pre>","url":"\/","script_name":"\/index.php"}


texts: Why does setIsAnchor(1); and $category->save(); not work sometimes. when changing the category Anchor?

texts:
Does anyone know why in some stores the save does not change the is_anchor and in some stores it does? It is not working on a multi-store site (multiple default root categories)., though there may be other reasons.

The code below generally works. When it does not it, the save has no effect, without any log errors.

$anchorNew has the correct value in it.

Mage::app()->setCurrentStore($store_id);

$categories = Mage::getModel('catalog/category')
    ->getCollection()
    ->addAttributeToSelect('*')
    ->addAttributeToFilter('entity_id', array("gt" => 1))
    ->setOrder('entity_id') ;

foreach($categories as $category) {
    $anchor = $category->getIsAnchor();
    if ($anchor == 1 ) {
        continue;
    }
    $category->setIsAnchor(1);
    $category->save();

    $anchorNew = $category->getIsAnchor(); // this shows a 1 in is_anchor
}

I checked the database and there are not as many entries in - catalog_category_entity_int
 WHERE attribute_id = 51 - as there are categories. The $category->getIsAnchor() returns null for many of my categories.


texts: Getting a "Please Specify a Shipping Method" exception during checkout

texts:
I've been getting exception logs for this error in production, but I'm unable to reproduce the issue in my local or staging environment, so it's been pretty hard to troubleshoot.

The error originates in Mage_Sales_Model_Service_Quote::_validate() because the $rate returned by $rate  = $address->getShippingRateByCode($method) is empty.

I've added in some logging to try and get a better idea of what was going on, and I can see that $method contains the correct shipping method.

My best guess is that at some point in the process, the shipping rates are being deleted prior to when they should be.

I've noticed that every time this exception occurs, it happens immediately after a legitimate exception, such as an invalid credit card.  I've tried to reproduce the issue by using an invalid credit card, then a valid one, but it doesn't reproduce for me - in staging, production, or local.

My initial hunch was that maybe the shipping method was getting lost somewhere after the first valid exception, but that's not the case, because I see that $method has the correct value at the time that this exception is thrown.

The checkout module that I'm using is AwesomeCheckout - it doesn't really to my knowledge have any custom logic when creating orders that should cause problems here, but might be related.

UPDATE: I've added in some code to attempt to recollect the rates if they are missing.

protected function _validate()
{
    if (!$this->getQuote()->isVirtual()) {
        $address = $this->getQuote()->getShippingAddress();
        $addressValidation = $address->validate();
        if ($addressValidation !== true) {
            Mage::throwException(
                Mage::helper('sales')->__('Please check shipping address information. %s', implode(' ', $addressValidation))
            );
        }
        $method= $address->getShippingMethod();
        $rate  = $address->getShippingRateByCode($method);

        /**
         * Start Customization
         */
        if (!$this->getQuote()->isVirtual() && !$rate) {
            Mage::logException(new Exception("Rate was empty inside quote validate method, trying to forcefully recalculate"));
            $this->getQuote()->getShippingAddress()->setCollectShippingRates(true);
            $this->getQuote()->setTotalsCollectedFlag(false);
            $this->getQuote()->collectTotals();
            $rate  = $address->getShippingRateByCode($method);
        }
        /** End Customization **/

        if (!$this->getQuote()->isVirtual() && (!$method || !$rate)) {
            Mage::throwException(Mage::helper('sales')->__('Please specify a shipping method.'));
        }
    }


texts: Create a product with different colors (associated products) where each color shares stock with all other colors

texts:
Is it possible to create a product with different colors where each different color points to the same stock?

For example, I have created a configurable product with a color attribute.
After creating the configurable product I create a couple of associated simple products for a few different colors.
Instead of having each color have it’s own product qty / stock, I want all the colors to share the same stock.

So for example the configurable product is a lamp. The associated simple products are lamp green, lamp red etc.
I want to tell Magento that the lamp product has 10 in stock. So when someone buys a lamp red, it will tell me there are only 9 lamps left in stock regardless of the color. Is this possible?

The way I have it now is that each associated simple product has it’s own stock, but this is not what I want in my case.

Thanks in advance for any help.


texts: Display checked radio button custom option value in product detail page Magento2

texts:
Below are custom option of Radio Button Type. How to Display  value under the  when customer checked Radio button using Jquery? Here All class are dynamic.
Example:
As per the below code I want to show red if customer click on first radio and blue if customer click on 2nd radio button

      <input type="radio" class="radio-product-custom-option" name="options[1]" id="options_1_2" value="1" data-selector="options[1]" price="10" aria-required="true">

        red

      <input type="radio" class="radio-product-custom-option" name="options[1]" id="options_1_3" value="2" data-selector="options[1]" price="20" aria-required="true">

        blue


texts: How to add Custom Top Links in Magento 2?

texts:
Hello Can you help me on how to add custom top links in the header area of Magento 2,

Like this:


texts: Limiting theming css files include by store within a module

texts:
I have a checkout module which have a little bit of new.css file are there. I want include if checkout module is enabled other wise no need. Unfortunately, its not include the page in head. if I remove ifconfig condition it's working other wise it's not included.
my code is

local.xml-> this is not working

<?xml version="1.0"?>
<layout version="0.1.0">
    <default>
<reference name="head">
            <action method="addItem" ifconfig="checkout/settings/enabled"><type>skin_css</type><name>css/new.css</name></action>
        </reference>
  </default>

local.xml-> this is working

<?xml version="1.0"?>
<layout version="0.1.0">
    <default>
<reference name="head">
            <action method="addItem" ><type>skin_css</type><name>css/new.css</name></action>
        </reference>
  </default>

Can any one tell me where I went wrong?

if checkcout module is enable this file should be include other wise no need.


texts: Magento 1.7.0.2 When I search for a product with quotation marks in it, it always adds a backslash before the quotes

texts:
My shop is run in Magento 1.7.0.2.

Let's say that I have a product that is listed as 5" Product. If I search for that product from the backend admin area, the search will change to 5\" Product.

Of course, this leads to the product not being found and didn't occur at all before a month ago.

How do I fix it?


texts:
I am using the following code to show my simple products on the configurable and then it sorts by price.

if($_product->getTypeId() == "configurable"): ?>
    <?php $conf = Mage::getModel('catalog/product_type_configurable')->setProduct($_product); ?>
    <?php $simple_collection = $conf->getUsedProductCollection()->addAttributeToSelect('*')->addFilterByRequiredOptions()->addAttributeToSort('Price', 'asc'); ?>

<?php   foreach($simple_collection as $simple_product){ ?>

I now want to filter to show only items that are in stock, maybe by using this code:addFilterByRequiredOptions()

Is it possible or is there another way?

Here is the complete file

<?php
$_helper = $this->helper('catalog/output');
$_product = $this->getProduct();
$theme = $this->helper('royal');
$prods = $this->helper('egproducts');
$prodsConfig = $prods->getConfig('prev_next');
$prodId = $_product->getId();
$prevProduct = $prods->getPreviousProduct($prodId, $prodsConfig['list_sort_by'], $prodsConfig['list_sort_dir']);
$nextProduct = $prods->getNextProduct($prodId, $prodsConfig['list_sort_by'], $prodsConfig['list_sort_dir']);
$rightEnabled = $theme->getSetting('product_page/eg_right_column');
$gridClass = "grid-full no-padding";
if ($rightEnabled)
    $gridClass = "grid12-9 no-padding-left-lg no-padding-left-md no-padding-xs no-padding-sm grid-xs-full grid-sm-full";
?>
<?php
if($_product->getTypeId() == "configurable"): ?>
    <?php $conf = Mage::getModel('catalog/product_type_configurable')->setProduct($_product); ?>
    <?php $simple_collection = $conf->getUsedProductCollection()->addAttributeToSelect('*')->addFilterByRequiredOptions()->addAttributeToSort('Price', 'asc'); ?>
<?php   foreach($simple_collection as $simple_product){ ?>

some content

<?php
    }
endif;
?>


texts:
I have about 65K SKU's, When i'm trying to import through data profile it generate about 7k record in Dataflow Batch Export Table in mysql and then just show 500 internal server error page,

memory_limit 2048M

php_value max_execution_time 180000

i have above memory and execution time setting for store.

Any suggestion or idea what is causing error.

Thank you


texts: Migrating from M1 to M2: need to / want to rename multiple attributes

texts:
in our mission to migrate from M1 to M2 we need / want to rename attributes that we have named say 7 years ago.

So product attribute 'manufacturer' would become 'brand'
and product attribute 'product_color' would become 'color'

We have tried looking at nginx rewrite. Only it does not handly query params editing very well and even less changing multiple! parameters.

SO I was thinking: as a workaround: could we add some kind of lookup / araay of old and new parameters somwhere that if/when we query in our layered bavigation for

manufacturer=51 or brand=51 => that the result would be the same? Or that the old attribute would be replace with a 301 to the new attribute?

and this would work with multiple attributes too?

manufacturer=51&product_color=1 becomes brand=51&color=1

Help appreciated ;)


texts:
I have a module, which grabs the customer information everytime a customer is updated.  Right now, the customer data is stored in the var log file and I want to send this information to a SOAP API, that was created for me through our software.

I have been provided with a URL for our webservice (http://pop.example.com/DPAPIServices/DPAPIServices.asmx)

and then an example of the SOAP message:

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:dpap="http://www.example.com/DPAPIServices">
    <soap:Header/>
    <soap:Body>
        <dpap:UpdateCustomer>
            <!--Optional:-->
            <dpap:aRequest>
                <!--Optional:-->
                <dpap:Username>DPAPI</dpap:Username>
                <!--Optional:-->
                <dpap:Password>password00</dpap:Password>
                <!--Optional:-->
                <dpap:CustomerNumber>123</dpap:CustomerNumber>
                <!--Optional:-->
                <dpap:CustomerName>Cust Name</dpap:CustomerName>
                <!--Optional:-->
                <dpap:CustomerAddress1>Cust Addr1</dpap:CustomerAddress1>
                <!--Optional:-->
                <dpap:CustomerAddress2></dpap:CustomerAddress2>
                <!--Optional:-->
                <dpap:CustomerCity>Cust City</dpap:CustomerCity>
                <!--Optional:-->
                <dpap:CustomerState>FL</dpap:CustomerState>
                <!--Optional:-->
                <dpap:CustomerZip>33701</dpap:CustomerZip>
            </dpap:aRequest>
        </dpap:UpdateCustomer>
    </soap:Body>
</soap:Envelope>

My observer method, looks like this:

<?php
class Mage_Customerupdate_Model_Observer
{
    public function logUpdate(Varien_Event_Observer $observer)
    {
        $customer = $observer->getEvent()->getCustomer();
        $name = $customer->getName();
        $customerId = $customer->getId();
        $billingaddress = $customer->getDefaultBillingAddress();
        // just check if there is a billing adress
        if ($billingaddress) {
            $fon = $billingaddress->getTelephone();
            $street = $billingaddress->getData('street');
            $city = $billingaddress->getCity();
            $region = $billingaddress->getRegion();
            $postcode = $billingaddress->getPostcode();
        }
        Mage::log("{$name} ({$customerId}) ({$fon}) ({$street}) ({$region}) ({$city}) ({$postcode})", null, 'customerupdate.log', true);
    }
}
?>

I am new to observer events, so maybe this is not how it should be done, but I figured out that I should at least give it a try before coming to you all.


texts: how to remove zip , fax , company field from checkout

texts:
I want to ask how to remove tax, company, middle name, zip postal code from checkout one page

Magento 1.9