texts: Getting error while adding image of product to cart using RSET API

texts:
I am facing one issue. I am adding configurable product to cart with its image,size and color but getting the below error using magento-2 REST API.

  Error:

{"message":"The image content must be valid base64 encoded data."}

I am adding my code below.

$user_id=$_POST['user_id'];
$psku=$_POST['sku'];
$qty=$_POST['quantity'];
$isConfigurable=$_POST['isConfigurable'];
$image=$_POST['image_url'];
$image_id=$_POST['image_id'];
$escaped_url=str_replace( '\/', '/', $image);
$type = pathinfo($escaped_url, PATHINFO_EXTENSION);
$data = file_get_contents($escaped_url);
$base64=base64_encode($escaped_url);
$itype='image/'.$type;
//$itype=str_replace( '\/', '/',$itype);
//echo $itype;exit;
$iname=basename($escaped_url);
//echo $base64;exit;
if ($isConfigurable==1) {
    if (isset($_POST['size_attribute_value'])) {
        $size_attribute_value=$_POST['size_attribute_value'];
    }else{
        $size_attribute_value='';
    }
    if (isset($_POST['size_attribute_id'])) {
        $size_attribute_id=$_POST['size_attribute_id'];
    }else{
        $size_attribute_id='';
    }
    if (isset($_POST['color_attribute_value'])) {
        $color_attribute_value=$_POST['color_attribute_value'];
    }else{
        $color_attribute_value='';
    }
    if (isset($_POST['color_attribute_id'])) {
        $color_attribute_id=$_POST['color_attribute_id'];
    }else{
        $color_attribute_id='';
    }
}
if ($isConfigurable==1) {
            $ettr=array();
            $citems=array(array("option_id"=>$size_attribute_id,"option_value"=>$size_attribute_value),array("option_id"=>$color_attribute_id,"option_value"=>$color_attribute_value),array("option_id"=>$image_id,"option_value"=>"file","extension_attributes"=>array("file_info"=>array("base64_encoded_data"=>$base64,"type"=>$itype,"name"=>$iname))));
            //$poption=array("extension_attributes"=>array("configurable_item_options"=>$citems));
            $poption=array("extension_attributes"=>array("custom_options"=>$citems));
            $item=array("quote_id"=>$quote,"sku"=>$psku,"qty"=>$qty,"product_option"=>$poption);
            $cartData=array("cartItem"=>$item);
        }else{
            $citems=array(array("option_id"=>$image_id,"option_value"=>"file","extension_attributes"=>array("file_info"=>array("base64_encoded_data"=>$base64,"type"=>$itype,"name"=>$iname))));
            $poption=array("extension_attributes"=>array("custom_options"=>$citems));
            $item=array("quote_id"=>$quote,"sku"=>$psku,"qty"=>$qty,"product_option"=>$poption);
            $cartData=array("cartItem"=>$item);
        }
        //echo json_encode($cartData);exit;
        $requestUrl ='http://example.com/index.php/rest/V1/carts/mine/items';
        $ch = curl_init($requestUrl);
        curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($cartData));
        curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: application/json", "Authorization: Bearer " . json_decode($token1)));
        $result = json_decode(curl_exec($ch));
        //print_r($result);exit;
        $array = json_decode(json_encode($result), True);
        echo json_encode($array);exit;

My json format boy input are like below.

{"cartItem":{"quote_id":"202","sku":"KB067","qty":"1","product_option":{"extension_attributes":{"custom_options":[{"option_id":"225","option_value":"175"},{"option_id":"93","option_value":"163"},{"option_id":"147","option_value":"file","extension_attributes":{"file_info":{"base64_encoded_data":"aHR0cDovL21hZ2VudG8tMTQ4NDg2LTQyNTc3NS5jbG91ZHdheXNhcHBzLmNvbS9wdWIvbWVkaWEvY2F0YWxvZy9wcm9kdWN0Ly8xLzEvMTEuanBlZw==","type":"image\/jpeg","name":"11.jpeg"}}}]}}}}

Here I am giving the full path of image(i.e-http:\/\/example.com\/pub\/media\/catalog\/product\/\/1\/1\/11.jpeg) and its id as input. Please help me to resolve this error.


texts: How to display correct configured product image in cart page according to selected option?

texts:
I want that when i click on add to cart button on product default page, The same image is shown on cart page according the selected color option of configurable product.

I tried below option from back-end but could not solve my problem,

System > Configuration > Sales > Checkout > Shopping Cart

and then set Configurable Product Image to Product Thumbnail Itself.

Is there any other way to do the same. ?


texts: magento2 -custom layout file not loading

texts:
i have followed the below link in order to get check if our custom layout xml file is loaded or not using the event: layout_generate_blocks_after

In the log file i just get:

2016-06-29T11:07:40+00:00 INFO (6):

 <layout/>

which should actually load my custom layout file :
catalogsearch_catalogsearch_resultcontroller.xml

Could any1 please help why my layout file is not loading.

UPDATED: LAYOUT file catalogsearch_catalogsearch_resultcontroller.xml

controller path:

Vendor\Module\Controller\Catalog
Vendor\Module\Controller\CatalogSearch
Vendor\Module\Controller\CatalogSearch\Result.php
Vendor\Module\Controller\CatalogSearch\ResultController.php

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

<?xml version="1.0"?>
   <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
     <referenceBlock name="catalogsearch.leftnav"><arguments>
        <argument name="setTemplate" xsi:type="string">Vendor\Module::search/filter.phtml</argument>
        </arguments>
    </referenceBlock>

    <referenceBlock name="product_searchlist_toolbar">
        <arguments>
            <argument name="template" xsi:type="string">Vendor\Module::toolbar/toolbar.phtml</argument>
        </arguments>
     </referenceBlock>

</body>

Above xml was replicated from 1x code which was as :

<?xml version="1.0"?>
<layout version="0.1.0">
 <catalogsearch_result_index>
    <reference name="catalogsearch.leftnav">
        <action method="setTemplate">
            <setTemplate>/filter.phtml</setTemplate>
        </action>
    </reference>
      <reference name="content">
        <reference type="catalogsearch/result" name="search.result">
            <reference name="search_result_list">
                <reference name="product_list_toolbar">
                    <action method="setTemplate">
                        <template>toolbar.phtml</template>
                    </action>
                 </reference>
            </reference>
        </reference>
    </reference>
</catalogsearch_result_index>
 </layout>

system.log :

Cache file with merged layout: LAYOUT_frontend_STORE1_3d41d8cd98f00b204e9800998ecf8427e and handles : Please correct the XML data and try again.  [] []


texts: magento: my "custom url rewrites" for menu are gone

texts:
Magento ver. 1.9.1.0

I created these categories, intended for the sub-menu to point to specific URL I desired.

Company
   |-------Contact Us
   |-------About Us

When clicked on 'Contact Us', I want it to go to "~/magento/contacts".
But it actually went to "~/magento/company/contacts.html"

So, after research, i set up the "URL Rewrite Management", and it worked then.
But after a few hours, my "Custom URL Rewrites" was somehow removed, and replaced with the original system generated URL.

(This seems happening after *reindexing* )

What did i miss? How to permanent rewrite URL?

Screen Shots: my URL rewrites steps.


texts: How to get final price for not current customer?

texts:
There is a special customer group named A which has it's own special catalog rules and group prices. I am going to display final price of another customer group named B for A users.
How can I get final price of another customer group which is not for the current user?


texts:
stumbled upon a problem,
have following in my setup, but occasionally it conflicts with fileuploader so when i use ui component to add field i have no such problem.

    $eavSetup->addAttribute(
        \Magento\Catalog\Model\Product::ENTITY,
        'custom_files',
        [
            ...
            'backend' => 'Vendor\Module\Model\Product\Attribute\Backend\File',
            ...
        ]
    );

wel since ui component is still pretty much new for me how i can specify backend model in ui component ?

<field name="custom_files">
    <argument name="data" xsi:type="array">
        <item name="config" xsi:type="array">
            ...
            <item name="formElement" xsi:type="string">fileUploader</item>
        </item>
    </argument>
</field>

if not mistaken source is specified as :

<field name="custom_files" class="Vendor\Module\Model\Product\Attribute\Source\File">


texts: Using the built-in price update javascript for custom entity options

texts:
Since none of the Magento built-in product types suit my needs, I am using custom entities to represent product options on the product page. These are not custom options, attributes, configurable products, or any of that, so forget about all that.

There are a number of features I'd like to keep, one of which is updating the price display as the user toggles various options.

I'm making a guess here, but I figure I should be able to simply supply my own configuration when making a call such as:

var opConfig = new Product.Options(<?php echo $this->getJsonConfig() ?>);

Where $this->getJsonConfig() is replaced with a method that defines my own configuration based on the options I am using. Assuming I use the same patterns found in view.phtml and it's descendants, is this all that is essential to updating the price display? Am I better off simply writing my own JS methods to handle this?


texts: Free Shipping option disappeared from admin pages

texts:
The "Free Shipping" option has disappeared from the following 2 admin pages:

Promotions -> Shopping Basket Price Rules -> Click on a rule -> Actions

Promotions -> Shopping Basket Price Rules -> Add New Rule -> Actions

Any idea how I can get it back?

You can see in the first image how it is supposed to look (this picture is from a different Magento install where the Free Shipping option is appearing)

And you can see in the second image, that it is missing.


texts:
I installed elastic search, Now I need to create layout / default.xml with this code:
<body>
    <referenceContainer name="mytheme_header">
        <block class="Smile\ElasticsuiteCore\Block\Search\Form\Autocomplete" name="top.search" as="topSearch" template="Smile_ElasticsuiteCore::search/form.mini.phtml">
            <arguments>
                <argument name="rendererList" xsi:type="array">
                    <item name="term" xsi:type="array">
                        <item name="title" xsi:type="string" translate="true">Search terms</item>
                        <item name="template" xsi:type="string">Smile_ElasticsuiteCore/autocomplete/term</item>
                    </item>
                </argument>
            </arguments>
        </block>
    </referenceContainer>
    <referenceBlock name="top.search">
        <arguments>
            <argument name="rendererList" xsi:type="array">
                <item name="product" xsi:type="array">
                    <item name="title" xsi:type="string" translate="true">Products</item>
                    <item name="template" xsi:type="string">Smile_ElasticsuiteCatalog/autocomplete/product</item>
                </item>
                <item name="category" xsi:type="array">
                    <item name="title" xsi:type="string" translate="true">Categories</item>
                    <item name="template" xsi:type="string">Smile_ElasticsuiteCatalog/autocomplete/category</item>
                </item>
                <item name="product_attribute" xsi:type="array">
                    <item name="title" xsi:type="string" translate="true">Attributes</item>
                    <item name="template" xsi:type="string">Smile_ElasticsuiteCore/autocomplete/term</item>
                    <item name="titleRenderer" xsi:type="string">Smile_ElasticsuiteCatalog/js/autocomplete/product-attribute</item>
                </item>
            </argument>
        </arguments>
    </referenceBlock>
</body>

I use Sm Market template.  I need call correct: <referenceContainer name="mytheme_header">
What block should I enter here. Some solution?


texts: How to get total amount of reviews belongs to one category? [Magento 1.9]

texts:
I am trying to generate SEO rich data in Magento for a category or listing page. I just don't understand how can I get the total amount of reviews for a that category.

I don't want to slow down the category page.

Is it possible to get that by directly executing an SQL command?

Please help me :(


texts: convert dropdwn list to radio buttons on configurable product page

texts:
Is there anyway to convert dropdown list to radio buttons in a configurable page please!
I'm using Magento 2.3
Thank you


texts: Magento 2 Place Order Programmatically Using Event Observer

texts:
Created a custom form where customer and product details filled with status of Active/Not active
So for now I want to create an event and observer to place order programmatically when status is Active from admin panel, place order on the bases of customer, product


texts: Why is the isTrackingAvailable() method not implemented in Mage_Shipping_Model_Carrier_Freeshipping?

texts:
The class Mage_Shipping_Model_Carrier_Freeshipping implements the interface Mage_Shipping_Model_Carrier_Interface which has two functions defined: getAllowedMethods() and isTrackingAvailable(). But only getAllowedMethods() is implemented and isTrackingAvailable() is not.

Why doesn't this cause an error?


texts: How to get order data before and after save in Magento 2?

texts: In Magento 2, How to get order data(before and after save) using plugin function. I tried this solution but it is not working.


texts: How to receive the protected object from the client, in an .phtml file 1.9.2

texts:
I need to get a value from the database and insert into an input, so I need to get that customer object in front-end phtml file.
EXAMPLE:
What I need to do is: Here I get the value of the object I need,
I put in a variable, and then I put in the input

teste.phtml
getCustomer() <---  I do not know how to call the object, it only returns me protected

<input type="text" value="<here object value from client object>"/>


texts: Magento2 : How to get block file in phtml file

texts:
To get block in magento1 we use echo $this->getLayout()->createBlock('module/adminhtml_module_grid')->toHtml().

What is the similar function in magento2?


texts: How to get data from a model without calling the objectManager in the template

texts:
I have a custom Order model, it has a method in it @method int getIncrementId()

I have a template to transfer the id of the current order/app/code/Qq/Www/view/frontend/templates/success/index/success_page.phtml

How do I get the ID after the form is submitted by this controller.

        if ($data) {
            /** @var \Qq\Www\Model\Order $model */
            $model = $this->_objectManager->create('Qq\Www\Model\Order');
            $model->setData($data);
            $model->setStoreId($this->_storeManager->getStore()->getId());

            try {

                $this->objectRepository->save($model);
                $this->messageManager->addSuccess(__('Request was added to processing.'));
                $this->dataPersistor->clear('dv_sample_order');

                // Send email
                $this->helper->sendEmail($model);

            } catch (\Magento\Framework\Exception\LocalizedException $e) {
                $this->messageManager->addError($e->getMessage());
            } catch (\Exception $e) {
                $this->messageManager->addException($e, __('Something went wrong while saving the data.'));
            }
        }
        return $resultRedirect->setPath('qq_success_page/success/index');

update

There is already a method in my Model

    public function getLastIncrementId()
    {
        $result = null;
        try {
            $result = $this->collection->create()->getLastIncrementId();
        } catch (\Exception $e) {
            $this->_logger->error($e->getMessage());
        }

        return $result;
    }

I create a block, pass such data to it

namespace Vendor\Module\Block;

class Success
{
    protected $_orderData;

    public function __construct(
        \Vendor\Module\Model\Order $_orderData
    ) {
        $this->_orderData = $_orderData;
    }

    public function getLastOrderId():? int
    {
        return $this->_orderData->getLastIncrementId();
    }
}

xml for my controller

    <referenceBlock name="content">
        <block class="Vendor\Module\Block\Success" template="Vendor_Module::success/index/success_page.phtml" name="vendor_success_page" />
    </referenceBlock>

my template

<?php echo $block->escapeHtml($block->getLastOrderId());?>

that not work for me


texts:
I want to get the current url of an admin panel page. I tried the folowing.

$currentUrl = Mage::helper('adminhtml')->getUrl();

But it's not returning the current url.


texts: How to use paypal for other currency in Magento2

texts:
I have magento2 with base currency NPR I want to use Paypal as another payment option. where as papal doesn't support NPR i want to pay it in droller.

for that I have added "NPR" in  $_supportedCurrencyCodes variable in vendor/magento/module-paypal/Model/Config.php

add logic for sending currency code "USD" instead of "NPR" and change amount to USD in vendor/magento/module-paypal/Model/Express/Checkout.php in "start" function while checkout it give me error for Paypal doesn't support for shipping to Nepal.
Is their any way to resolve this?


texts: How do I observe which order created by admin(magento backend) or customer(frontend)

texts: How to observe who create new order in  Backend. Should I add new grid or new status.


texts: Sales : Orders :How to add custom order status programmatically

texts:
I need to add custom status for an order programatically
I have below controller file to save order status.
I need to add custom status as cancel initiated.Provide me a solution...

Controller file

public function execute()
    {
        $orderId = 3;
        $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
        $order = $objectManager->create('\Magento\Sales\Model\Order')->load($orderId);
        $order->addStatusHistoryComment('');
        $orderState = Order::STATE_PROCESSING;
        $order->setState($orderState)->setStatus(Order::STATE_PROCESSING);// Here I need to add custom status as Cancel initiated
        $order->save();

        $resultPage = $this->_resultPageFactory->create();
        return $resultPage;
    }

It is failed to fetch or change the status dropdown


texts: Customer redirect on previous page after login Magento2

texts: Is there any solution for the customer, like After login customer redirected to the previous page?


texts: Magento 2: Pre-populate some name and address fields using KnockoutJS

texts:
I would like to update the content of the firstname and surname fields on the checkout. The UI input fields already have the value data-bind (see below) which I'd like to target in my js/view file and update its value.

<input
class="input-text"
type="text"
data-bind="
    value: value,
    valueUpdate: 'keyup',
    hasFocus: focused,
    attr: {
        name: inputName,
        placeholder: label,
        'aria-describedby': noticeId,
        id: uid,
        disabled: disabled
}"
name="firstname"
placeholder="First Name"
aria-describedby="notice-IE29P4K"
id="IE29P4K"
>

How would I target just the value data-bind of the firstname and surname input fields?


texts: Apache 404 Error for url redirect for files in pub static folder

texts:
I am having problem with my setup in local and live, when I try to hit a url that dd not exist in : pub/static/frontend/XXX/default/ folder it gives me apache 404 error. I have my alias or domain pointing to pub folder and my htaccess are fine.

I tried to hit this URL:

  dev.ndspro.com/static/version1525430192/frontend/Nds/default/en_US/images/stories/landingpage/pdf/EZflow_Manual_Web.pdf

Unable to resolve the source file for 'frontend/Nds/default/en_US/images/stories/landingpage/pdf/EZflow_Manual_Web.pdf'
#0 /home/devnds/public_html/releases/20181026112235/vendor/magento/framework/App/StaticResource.php(121): Magento\Framework\View\Asset\File->getSourceFile()
#1 /home/devnds/public_html/releases/20181026112235/vendor/magento/framework/App/Bootstrap.php(256): Magento\Framework\App\StaticResource->launch()
#2 /home/devnds/public_html/releases/20181026112235/pub/static.php(13): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\StaticResource))
#3 {main}


texts:
Source model "giftvoucher/templateoptions" not found for attribute "gift_template_ids"
error occurs in the search result page.

I found similar questions like my question. But i did not get the result.

I don't know where the error come from. I have checked all modules.

Somebody advice me.


texts: Magento 2 some Product URLs show Category path

texts:
In my magento 2.2.4 setup some products of some categories show the category path and some do not. i checked all settings but I dont see the difference.

In all store views (Default, etc.) I have setup "NO" for the below setting:

  Stores/Configuration/Catalog/Catalog/SearchEngineOptimisation/Use
  Categories Path for Product URLs

I have ran the reindex several times but no results so far.


texts: How to override system.xml core file in magento2

texts:
I would like to change New order status text to something else at payment method section of magento2 admin.

Admin->Store->Configuration->Sales->Payment method->Check / Money Order

See attachment for better reference.

I know that i can change this by core changes but i would like to change this text without making any change in core file.

I am able to do this by editing system.xml

vendor/magento/module-offline-payments/etc/adminhtml/system.xml


texts: Magento 2 How can I get selected swatch options on wishlist page?

texts:
I am trying to get selected swatches color, the size on wishlist page in Magento 2.3

If I add a simple product in wishlist then attribute value is showing but when I am trying to get selected options from the configurable product then the option's value is not showing.

Can anyone help to do this?


texts: Magento 2 Add selected products to cart from cms page

texts:
I am working in Magento 2.3.5. I have 4 custom checkboxes to select product id on a cms page, I want to add selected products to add to cart by clicking on a button "Add selected items to cart". Can anyone help me with this? Please provide complete steps to implement this feature.
Thank you so much in advance.


texts: Magento2: Local-Storage Mage-Storage and Mage-Cache Empty on every Reload

texts:
Many features in my web page break as when I investigated, I found out that
many local storage keys don't even exist now which used to exist before.

list of keys that don't exist:

lo_session
mage-banners-cache-storage
mage-banners-cache-timeout
mage-cache-storage
mage-cache-storage-section-invalidation
mage-cache-timeout
...
and many more

What could be the reason and how to fix it.


texts: Checkout top link resulting in 500 error

texts:
I'm in need of some assistance.  When I click on the top link "Checkout" on my site, redirected to https://MyURL.com/checkout/ and given a 500 error. When I clink on "Cart" and then "Proceed to Checkout" I reach to https://MYURL.com/checkout/onepage and the working checkout page.Using Chrome Inspect on the "Checkout" top link I get:

Checkout

It would seem the quick fix would be to add "onepage" to the end of that href?  Problem is, I can't seem to find that code anywhere to edit it, or anyth on the backend of Magento where one redirects top links if there is such a thing.

I'm starting to lose my sanity over what seems like a quick fix.  Please advise.  Be gentle.  I'm fairly new to all this stuff.


texts: Magento2 : module created but when trying to display the grid in admin getting the error as

texts:
I am new to magento and learning to create a module in magento.

  Fatal error: Method
  Magento\Ui\TemplateEngine\Xhtml\Result::__toString() must not throw an
  exception, caught TypeError: Argument 1 passed to
  Magento\Framework\View\Element\UiComponent\DataProvider\DataProvider::searchResultToOutput()
  must implement interface
  Magento\Framework\Api\Search\SearchResultInterface, instance of
  Chirpn\ProductSerialNumber\Model\ResourceModel\ProductSerialNumber\Collection
  given, called in
  E:\wamp64\www\utt\vendor\magento\framework\View\Element\UiComponent\DataProvider\DataProvider.php
  on line 284 in
  E:\wamp64\www\utt\vendor\magento\module-ui\Component\Wrapper\UiComponent.php
  on line 0

my di.xml file is as below :

<virtualType name="Chirpn\ProductSerialNumber\Model\ResourceModel\ProductSerialNumber\Grid\Collection" type="Magento\Framework\View\Element\UiComponent\DataProvider\SearchResult">
    <arguments>
        <argument name="mainTable" xsi:type="string">wk_grid_records</argument>
        <argument name="resourceModel" xsi:type="string">Chirpn\ProductSerialNumber\Model\ResourceModel\ProductSerialNumber</argument>
    </arguments>
</virtualType>
<type name="Magento\Framework\View\Element\UiComponent\DataProvider\CollectionFactory">
    <arguments>
        <argument name="collections" xsi:type="array">
            <item name="productserialnumber_record_productserialnumber_list_data_source" xsi:type="string">Chirpn\ProductSerialNumber\Model\ResourceModel\ProductSerialNumber\Collection</item>
        </argument>
    </arguments>
</type>
<type name="Chirpn\ProductSerialNumber\Logger\Handler">
    <arguments>
        <argument name="filesystem" xsi:type="object">Magento\Framework\Filesystem\Driver\File</argument>
    </arguments>
</type>
<type name="Chirpn\ProductSerialNumber\Logger\Logger">
    <arguments>
        <argument name="name" xsi:type="string">customLogHandler</argument>
        <argument name="handlers"  xsi:type="array">
            <item name="system" xsi:type="object">Chirpn\ProductSerialNumber\Logger\Handler</item>
        </argument>
    </arguments>
</type>


texts: i am using Magento CE 1.9.1.0 and i just noticed an admin account called _auto_update with an email of auto_update@magento.com . I never created this user and i dont recall it being there when i downloaded and installed magento. I didnt install any modules recently and none of the modules i previously installed did this. I only applied the needed security patches to this installation and nothing else. Where did this user come from? P.S i have a test website is just about identical to this production website but this user does not exist


texts: How to increase the paging limit in magento 1.9 REST API

texts:
I am using the following code to fetch category tree where almost i want to fetch around 1000 records  but only getting  100 records because of limit.

$resourceUrl = "$apiUrl/categories/store/default?limit=100";

Here limit=100 is the maximum value if it exceed,  like

$resourceUrl = "$apiUrl/categories/store/default?limit=101";

it is giving the following error

Please help me to get through this problem and provide solution to increase this limit to 1000 or more vlaue.


texts: Use slide animation for opening tabs or accordions

texts:
I'm trying to update the product tabs/accordions to animate when I select them. I've removed the tab styling and adjusted them so they are accordions that open up and down on the page. I'd like to have them slide open with a small amount of transition duration, but I can't figure out the animate property for the accordion widget.

I've tried a handful of property variations based on this documentation and I can't figure out what I'm missing. It's based on jQuery.animate(). https://devdocs.magento.com/guides/v2.3/javascript-dev-guide/widgets/widget_tabs.html#fedg_tabs_options.

Some of the things I've tried:

1. $("#product-details-accordion").accordion({ "animate":{"easing": "easeOutExpo", "duration":"350"} });
2. $("#product-details-accordion").accordion({ "animate": { "display": "block", "easing": "swing", "duration": 500 } });
3. $("#product-details-accordion").accordion({ "animate": { "height": "100%", "easing": "swing", "duration": 500 } });

Thanks in advance for any suggestions!


texts: Magento 2 - Add additional constructor argument widget block class

texts:
I'm trying to create a custom widget by extending the existing "Banner Rotator" widget. Something similar to this.

I placed the widget.xml in my module and created a class extending \Magento\Banner\Block\Widget\Banner. Then my custom widget started to appear in BO and works fine (works just like the Magento widget because I haven't customized it yet).

Now I intend to do some additional manipulations to the rotator using the applied layered navigation filters. To do that I'm trying to inject the \Magento\Catalog\Model\Layer\Resolver in to my class. But it fails with this error message.

  Fatal error: Uncaught TypeError: Argument 4 passed to
  MyNamespace\Module\Block\Widget\Banner::__construct() must be an
  instance of Magento\Catalog\Model\Layer\Resolver, none given, called
  in
  /var/www/html/var/generation/MyNamespace/Module/Block/Widget/Banner/Interceptor.php
  on line 14 and defined in
  /var/www/html/app/code/MyNamespace/Module/Block/Widget/Banner.php on
  line 12

Looks like I cannot have a fourth argument in my class.

My class looks like below.

namespace MyNamespace\Module\Block\Widget;

class Banner extends \Magento\Banner\Block\Widget\Banner
{
protected $layerResolver;

public function __construct(
    \Magento\Framework\View\Element\Template\Context $context,
    \Magento\Banner\Model\ResourceModel\Banner $resource,
    array $data = [],
    \Magento\Catalog\Model\Layer\Resolver $resolver
)
{
    parent::__construct(
        $context,
        $resource,
        []
    );
    $this->layerResolver = $resolver;
}
}

How do I add the 4th argument?


texts: How to write superscript Registered ® and Rx in Magento 2 Product name

texts:
I have many products in the website having product name like "Cialis ® (Tadalafil) Rx 20 mg"
I want to write in superscript both "®" and "Rx" but they are not written in  tag because Magento Product name also show tag in frontend.
So what I have to do, help me out from this problem.
How to show ® and Rx both in superscript


texts:
This is similar to this question, but I think I understand what I'm trying to do I just don't understand why calling $product->addImageToMediaGallery is throwing an error.

I am trying to generate images for products on the fly inside of a catalog_product_save_before observer using imagejpeg.  The images are drawn from a custom attribute added to categories (each category's products will each share the same background image) with the product's title written on top and saved.

All of this works currently, I generate the image and right now I am storing it inside of media/tmp.  I want to tell Magento to go ahead and generate all of the assorted sizes that product images normally get generated to, and then add those images to the product, storing them at the correct place inside of the media/catalog/product directory.

As far as I know, calling $product->addImageToMediaGallery($filePath, $imageType, false) will just set the path to the product image at it's current location inside of media/tmp, which I don't want.  Is there a particular way to instruct Magento to go ahead and run the thumbnail resize process and move the image to its correct media location?

Update

I tried going this route, and added the following to my observer once the generated image is ready:

// Adapted from: @Zachary Schuessler, https://stackoverflow.com/a/10540132/697370
// Add three image sizes to media gallery
$mediaArray = array(
    'thumbnail'   => $filename,
    'small_image' => $filename,
    'image'       => $filename,
);

// Remove unset images, add image to gallery if exists
$importDir = Mage::getBaseDir('media') . DS . 'tmp/';

foreach ( $mediaArray as $imageType => $fileName ) {
    $filePath = $importDir . $fileName;
    if ( file_exists($filePath) ) {
        $product->addImageToMediaGallery($filePath, $imageType, false);
    }
}

When this runs, I can see images being generated inside of /media/tmp/catalog/product/(a)/(b), but when it hits /app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Media.php on line 329, I get an error: Warning: Invalid argument supplied for foreach()  I look up that line, and it looks like this, inside of Mage_Catalog_Model_Product_Attribute_Backend_Media::addImage:

foreach ($mediaGalleryData['images'] as &$image) {

I quickly put in a dump and die statement on the media gallery data:

array (size=2)
  'images' => string '[]' (length=2)
  'values' => string '{"image":"no_selection","small_image":"no_selection","thumbnail":"no_selection"}' (length=80)

Sure enough, I don't think you can foreach over a string like that.  I'm pretty sure my path is right beause the images are being generated correctly in the media/tmp/catalog/products directory, but I cant seem to be able to get this addImageToMediaGallery call to work the way I think that it should.


texts: Magento 2.x Layered Navigation in Advance Search Result

texts:
How can I add Layered Navigation in Advance Search result page?

In catalog search it is displaying Layered Navigation. But as I got result from Advance Search the left sidebar disappeared.

I want Layered Navigation in this left sidebar.

I am using Magento 2.0.7 Enterprise edition.


texts: $_FILES in Magento2 ECG : system configuration

texts:
How can I use $_FILES (Super global variable )in Magento2 system configuration as per ECG coding standard. I know I can use in simple form like below. where my_file_uploader is name of fieldId

$uploader = $this->_objectManager->create(
  'Magento\MediaStorage\Model\File\Uploader',
  ['fileId' => 'my_file_uploader']
);

But whats is the fieldId in system configuration ?

I have tried several way but couldn't succeed. I have tried

$uploader = $this->_objectManager->create(
      'Magento\MediaStorage\Model\File\Uploader',
      ['fileId' => '[groups][MY_GROUP][fields][import][value]'
    );

but it gives me error like

Undefined index: in /var/www/html/magento21/vendor/magento/framework/File/Uploader.php on line 542

any help will be appreciated

Thanks.


texts: get product small image url not working with resize

texts:
i want to get product image url from id

i wrote below code but it not working

$baseproductimage = Mage::getModel('catalog/product')->load('223')->getSmallImage()->resize($list_image_width,$list_image_height);


texts:
I cannot enable product reviews on a Magento 1.9.1.1 installation.

The module output is enabled in

System > Configuration > Advanced > Advanced > Disable Modules Output

However no trace of Product reviews in

System > Configuration > Catalog

or

Catalog

The website previously had installed Yotpo reviews but the module has been uninstalled.

I also verified the theme xml configuration files and there is no reviews module suppresion.

Any hints on troubleshooting?


texts: Magento 2.3.4 - Image gallery order issue in fullscreen

texts:
On Product page , When i am clicking on the image, the first image will be automatically selected on the image full screen view, so I have to re-click on the image which I want to see.
Example : I have total 5 product images , after clicking on the 3rd image , On full screen view it is showing 1st image instead of 3rd one.


texts: I want to limit number of order by customer on our Sale Day

texts:
Actually we are going to sell Items very cheap on our Sale Day for Marketing So we want that one customer can place only one order on that day.

I have already made a module so that customer will have only one product in entire cart but I am not getting how can I limit Number of orders by customer on that day.


texts: add custom attribute to customer in graphql magento 2

texts:
my custom module

schema.graphql

input CustomerInput {
    sample_attribute: String @doc(description: "new attribute")
}

  but not adding this attribute in customer mutation

  magento 2 graphql

  I created a custom attribute in Magento backend for Customers

sample_attribute

  I tried this answer Answer

how I can solve this??


texts: How can I have a footer with 3 blocks of links?

texts:
I currently made 3 "Link Blocks" and added them as widgets to my footer. The CSS was messed up and the block were NOT side by side aligned. Then, I added "display:flex" to ".links" div class. Now the Footer looks great and is side by side (not in mobile tho).

The Problem now is, there are multiple div classes called ".links", so they also have the css property "display:flex". This messes up some things like the image down below.

If someone could help me with this problem, I would be very very happy!


texts: Add 'Delete my account' link in Customer Navigation Menu

texts:
Is there a way to place a link (ie called Delete my account next to the Log out link in the Customer Navigation Account Dashboard?

I know there are paid extensions available for that but I'd like to know if it's possible by means of a simple module or via the local.xml?


texts:
there are blank spaces showing up on pages where products are listed. These random blank blocks instead of just listing the next product show up on the storefront and cannot figure out why. HELP?

  https://store.maniosdigital.com/index.php/catalogsearch/result/?q=vocas
  https://store.maniosdigital.com/index.php/catalogsearch/result/?q=hawk


texts: Remove Validation for Last Name Field from all places

texts: I want to remove validation from lastname field from admin panel as well as frontend in magento 2.1.12.Please tell me solution.


texts: dateRange filter can not properly parse format

texts:
I have a datetime column for custom made listing, where date filter calendar can not process given date format.
<column name="ticket_time" sortOrder="150" class="Magento\Ui\Component\Listing\Columns\Date" component="Magento_Ui/js/grid/columns/date">
  <settings>
    <filter>dateRange</filter>
    <dataType>date</dataType>
    <dateFormat>yyyy-MM-dd HH:mm:ss</dateFormat>
    <timezone>true</timezone>
    <label translate="true">Event time</label>
  </settings>
</column>

While column value is displayed properly, filter input values look like this when selected - "2020-10-23 HH:10:ss" and with such value filtering does not work anymore, so i can not ignore that
It would be even OK in my case to have to have only dates in filter, but this dateFormat is also tied with column value, there I need to have time also displayed.
So either I need the daterange to understand the format or either specify different format for filer only with date.


texts: Duplicate Category Filter Block Causing issue

texts:
I have two blocks of the same type on the category page, set in local.xml:

<block type="catalog/layer_view" template="catalog/layer/view.phtml"/>

When using the category filter an error is thrown:

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

I understand from multiple sources that it is because the category page has two blocks of the same navigation.

But my design requires that I have two different filter areas on the category page.

All other resolutions I've found say to just remove one of the blocks - this is not an option in this scenario.

Any ideas? Thanks.


texts:
I have problem with overriding Magento extension Front-end layout. I have installed extension Youama Ajax Login and Register. Now I need to override layout of login and register.

My app/code/local/Tech/Theme/etc/config.xml file :

<frontend>
<layout>
        <updates>
            <tech_theme>
                <file>tech_ajaxlogin.xml</file>
            </tech_theme>
        </updates>
    </layout>
</frontend>

My tech_ajaxlogin.xml file contain same default extension xml (copied file) and changed

            <action ifconfig="youamaajaxlogin/settings/power"
                    method="setTemplate">
                <template>ajaxlogin/ajaxlogin.phtml</template>
            </action>

And ajaxlogin.phtml file in app/design/frontend/rwd/tech/template/ajaxlogin path.

Now I'm confused where exactly tech_ajaxlogin.xml file should be located to override base xml file. I have tried in many places. But no luck.

Any help appreciated

Edited:

Config.xml :

 <?xml version="1.0"?>

<config>
    <modules>
        <Tech_Theme>
            <version>0.1.0</version>
        </Tech_Theme>
    </modules>
    <global>
        <blocks>
            <tech_theme>
                <class>Tech_Theme_Block</class>
            </tech_theme>
        </blocks>
    <helpers>
            <tech_theme>
                <class>Tech_Theme_Helper</class>
            </tech_theme>
        </helpers>
    <models>
            <tech_theme>
                <class>Tech_Theme_Model</class>

            </tech_theme>
            <youama_ajaxlogin>
                <rewrite>
                    <!-- Model -->
                    <ajaxregister>Tech_Theme_Model_Ajaxregister</ajaxregister>
                </rewrite>
            </youama_ajaxlogin>

        </models>

    </global>
    <frontend>
    <layout>
            <updates>
                <tech_theme>
                    <file>tech_ajaxlogin.xml</file>
                </tech_theme>
            </updates>
        </layout>
    </frontend>
</config>


texts:
I'm trying to show the label "Tax amount: 40$" in mu product page, just under the price, as this image

I enabled in the System > Configuration > Sales > Tax
almost every display with "show including tax and without tax" and "Show tax in the total" in every tab but I still not seeing it, just a double price with tax and without tax.
How could do as the image show?
Someone could give me some advice?

Thank you very much!
Cheers.


texts: magento 2 , unable to remove fb conversion event code in minicart

texts: I've added FB conversion event script in mini cart sidebar, wanted to cancel now and I've tried to remove the script in code and refresh the cache but still, it's showing the script.


texts: Dynamically render custom attribute visibility based on another custom attribute

texts:
i want to override admin->catalog->product->save page, it can be possible dynamic render changing custom attribute visibility ?
example: switch control Enable RMA,

thanks for helping


texts:
Magento 1.4.0.1

/downloadable/download/link/id/MC43OTA2MzIwMCAxNDQ3NTc2NTczMTg1MjE3MDM0MDY5MDE,/

I need to get the hash (MC43OTA2MzIwMCAxNDQ3NTc2NTczMTg1MjE3MDM0MDY5MDE,) ONLY from this:

$this->getPurchasedLinkUrl($link);

Is there a function to do that?


texts:
I am currently receiving a strange bug on my cart site.

The form shipping-zip-form is gone missing on the page, althoug the default/base phtml for this is used (magento/app/design/frontend/base/default/template/checkout/cart/shipping.phtml)

The code contains:

<?php echo $this->__('Estimate Shipping and Tax') ?>

   <form action="<?php echo $this->getUrl('checkout/cart/estimatePost') ?>" method="post" id="shipping-zip-form">

<?php echo $this->__('Enter your destination to get a shipping estimate.') ?>

When i look in the cart i only receive:

Geschätzte Versandkosten und Steuern

Geben Sie Ihren Standort an, um die geschätzten Versandkosten/dauer zu ermitteln.

I tested a little bit arround with an override in my own theme and when i put the following line above the form:

<form id="testform"></form>

It will then look like this:

<?php echo $this->__('Estimate Shipping and Tax') ?>

<form id="testform"></form>

    <form action="<?php echo $this->getUrl('checkout/cart/estimatePost') ?>" method="post" id="shipping-zip-form">

<?php echo $this->__('Enter your destination to get a shipping estimate.') ?>

And the frontend cart shows:

    <form action="http://dev.suppastore.com/checkout/cart/estimatePost/" method="post" id="shipping-zip-form">

Geben Sie Ihren Standort an, um die geschätzten Versandkosten/dauer zu ermitteln.

Notice: my testform is now missing instead of the shipping-zip-form.

The only thing i can currently think about is that an module is removing the form before the site is rendered.
Is there any way to figure out which module rewrites it?
Or is this probably a strange bug? When i activate the rwd theme it is not happening.


texts: Magento 2: How to add hyperlink on text in knockout template

texts:
Welcome message = "Welcome Sign-in".

I want to add my account link on Sign-in text in the welcome message.
sign-in text should be a link and direct the user to my account page.

<?php
$welcomeMessage = $block->getWelcome();
?>
<?php switch ($block->getShowPart()):
    case 'welcome': ?>

            <span data-bind="text: new String('<?= $block->escapeHtml(__('Welcome, %1!', '%1')) ?>').replace('%1', customer().fullname)">

                <span data-bind='html:"<?= $block->escapeHtml($welcomeMessage) ?>"'>

            <?= $block->getBlockHtml('header.additional') ?>

    <?php break; ?>

    <?php case 'other': ?>
        <?= $block->getChildHtml() ?>
    <?php break; ?>

<?php endswitch; ?>

Please help me to add my account URL here or let me know if any better way to achieve this.
Thanks


texts: How can I sort a category product loop by position with elastic search outside of category page?

texts:
I am creating a product loop on the homepage of our site. The site has smile elastic search running. I have set up the manual sort for products in the category admin and can loop thru the products, but I am not able to sort by position.

<?php foreach ($category as $categoryId): ?>
<?php

$category = $categoryFactory->create()->load($categoryId);
$categoryProducts = $category->getProductCollection()
                        ->addAttributeToSort('position','ASC')
                        ->addAttributeToSelect('*');

?>

<?php foreach ($categoryProducts as $product): ?>

    // do something with the products

<?php endforeach ?>


texts: How to Add a Payment Method Filter Field to Order Collection

texts:
At the moment I have this code:

$orders = Mage::getModel('sales/order')->getCollection()
    ->addFieldToFilter('state',array(array('like'=>'processing')));

Is there a way to add a filter to getCollection() to also filter the orders by payment method or description? something along the lines of:

$orders = Mage::getModel('sales/order')->getCollection()
    ->addFieldToFilter('state',array(array('like'=>'processing')))
    ->addFieldToFilter('method',array(array('nlike'=>'paypal')));

If it is only possible by using the filter on single orders, how would i go about doing that? This doesnt seem to work:

$invoices = Mage::getModel('sales/order')->loadByIncrementId($parentOrderNr)
    ->addFieldToFilter('method',array(array('nlike'=>'paypal')));


texts: Make parent category clickable in mobile device Magento 2

texts:
We have two level categories created on the magento 2 site,
Once mouse hover on Parent category a sub category shows up, and when click on parent category its redirected to that category page in Desktop version.
Whereas in mobile devices, on clicking parent category a sub category section is expanded instead of redirecting to category link.
Can we redirect to category link when click on parent category in mobile device also with expand and collapse feature for those have sub categories..
Please someone suggest how this can be done. Thanks!!


texts: Magento DevBox Beta Speeds Magento 2 Setup - Container is not working

texts:
I have installed the docker on Windows 7. It's working fine and run as well.

I installed the Magento site using Varnish and Redis, so works fine.

When I tried to enable the deploy:mode:set to developer mode my container stopped.


texts: What is the best way to redirect 2500 links after relaunch?

texts:
We have rebuilt a shop in Magento 1.9. The old shop was a "modifed shop".
Unfortunately, all links within the page structure change.

like this:

Main Category

myshopdomain.com/Category:::121_428.html

myshopdomain.com/category.html

SubCategory

myshopdomain.com/Category/Sub-Category:::158_142.html

myshopdomain.com/category/sub-category.html

Product

myshopdomain.com/Category/Sub-Category/Product:::4518.html

myshopdomain.com/category/sub-category/product.html

These are about 2500 links.
How do I solve this?
Do we have to enter all this manually in the backend?
or maybe better in the .htaccess

like:
0. convert to lowercase
1. cut in front of ":::"
2. ad ".html"
3. Forwarding.

hmm ...

Maybe someone has a tip

greetings
Heiko


texts: Magento 2: after get qty its show zero always

texts: After get qty its show zero always Magento2


texts:
I want to create a store by magento and selling digital files (mp3, pdf, mkv, mp4). but i need to send resumable link to my customer by email.
magento have not configuration for resumable link by defult. but i need to create resumable link
can you help me?


texts: Active class missing from category navigation if cache is enabled

texts:
First things first, this problem is already described and acknowleged as a bug on Github.

If FPC (varnish) is enabled, the active HTML class will be missing from the category menu on the frontend. None of the usual things helps including rm -rf pub/static/*, redeploying static, reindexing or flushing caches.

Though the currently active category receives the proper HTML class if you disable FPC.

Since this problem is known but the Magento team seemingly not interested in fixing it. I'd like to know if anyone has found a way around this behavior - neither disabling the cache nor having no visual clue of the current category is desirable.


texts:
I tried to add custom data to the endpoint V1/categories but ended up with getting error
My code is below

etc/extension_attributes.xml

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Api/etc/extension_attributes.xsd">
    <extension_attributes for="Magento\Catalog\Api\CategoryRepositoryInterface">
        <attribute code="banner_slider" type="string" />
    </extension_attributes>
</config>

2.di.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <type name="Magento\Catalog\Api\CategoryRepositoryInterface">
        <plugin name="banner_image_data" type="Vendor\ModuleName\Plugin\Model\CategoryRepository"/>
    </type>
</config>

3.Plugin
use Magento\Catalog\Model\CategoryRepository as Subject;

class CategoryRepository
{

    /**
     * @param Subject $subject
     * @param CategoryInterface $data
     * @return CategoryInterface
     */
    public function afterGet(
        Subject $subject,
        CategoryInterface $data
    )
    {
        $extensionAttributes = $data->getExtensionAttributes();
        $extensionAttributes->setBannerSlider('sandesh');
        $data->setExtensionAttributes($extensionAttributes);
        return $data;
    }
}

My error
 Call to undefined method Magento\Catalog\Api\Data\CategoryExtension::setBannerSlider()


texts:
I am using theme254k in Magento 1. I would like to remove Compare Products section of side bar of Category Page. How can I do that ??

I found below code in catalog.xml

<default>

        <reference name="right">

        </reference>
        <reference name="left">
            <block type="catalog/product_compare_sidebar" after="cart_sidebar" name="catalog.compare.sidebar" template="catalog/product/compare/sidebar.phtml"/>
            <block type="core/text_list" name="side.menu" as="sideMenu" translate="label" before="-">
                Navigation Bar
                <block type="page/html_topmenu" name="catalog.topnav2" template="page/html/sidemenu.phtml"/>
            </block>

        </reference>
        <reference name="footer_links">
            <action method="addLink" translate="label title" module="catalog" ifconfig="catalog/seo/site_map">Site Map<url helper="catalog/map/getCategoryUrl" /><title>Site Map</title></action>
        </reference>
        <block type="catalog/product_price_template" name="catalog_product_price_template" />
    </default>

I removed below code from above code

<block type="catalog/product_compare_sidebar" after="cart_sidebar" name="catalog.compare.sidebar" template="catalog/product/compare/sidebar.phtml"/>

But Compare Product is not removed.


texts: Magento 1: Checkout redirecting to empty page

texts:
Ordering process is redirecting to empty cart in my Magento 1 installation. What I noticed is Magento creates a second "/" Session and Local storage variable and that is probably causing the redirect to empty cart and not success site. Also after log-in in get empty page site.

On all other shop sites there is always just one Session/Local variable.

This is happening on site example.com/index.php/checkout/onepage/.

Does anyone have any advise what is causing this (are there any setting related to that)?
How could I resoltve this?


texts: Magento 2 - Custom Module's _module.less file not updating

texts:
In a custom module I've created I'm using a _module.less file in it.  At first it worked but any changes I make to it are not updating on the frontend.

I think it must be a cache issue but so far everything I've tried to fix it has not worked:

php bin/magento setup:upgrade; php bin/magento setup:di:compile;
php bin/magento cache:clean; php bin/magento setup:static-content:deploy;
rm -rf var/cache/; rm -rf var/generation/

I'm working in developer mode.

Any ideas?

UPDATE

I checked Less files in custom modules but unfortunately this does not answer my question.  It explains how to use LESS in a custom module but not how to troubleshoot the issue I am having with the cache other than what I've tried already (see above).


texts: Getting the contents of the Shopping Cart

texts:
With PHP code I want to get at the contents of the shopping cart in Magento 2.

Here is my code:

/** @var $block \Magento\Checkout\Block\Cart */
$items = $block->getItems();
foreach( $items as $xx ){
    var_dump($xx->getSku());
    var_dump($xx->getQty());
    var_dump($xx->getName());
    $opts = $xx->getOptions();
}

Using this code I can get at the SKU, the Quantity and the Name of the items in the shopping cart.

However I need to also get at the configurable options (I need to know the colour and size of the items in the shopping cart).

Can anyone help me get at this information? I believe it is in $opts, but I cant figure out how to get the information out of there.


texts: Add Custom Product Grid Created Date And Created By Magento 2

texts:
In magento 2 admin panel, at product list grid area, i want to add one more grid with date, that date define product create date. so we get idea at which time product was created.

And i also want to add by whom it created, we have so many admin so we want to know by whom that product created.

So we need that 2 column on product grid area in admin side.


texts: Magento 2 - What is file Interceptor.php?

texts:
When I overrided file controller of catalog/product and ran this command:

  php bin/mangento setup:di:compile

And then this file "Interceptor.php" was generated in magento_root\var\generation\myPool\myModule\Controller\Adminhtml\Product\Initialization\Helper\Interceptor.php

Anyone, are you know? What is this file?


texts: Magento 2 - How to get all items in cart?

texts:
At checkout page (chekout/cart) I want to edit the checkout button url destination based on cart items (link.phtml).

How can I get all items in cart? I want to do this without using the API. Thanks.


texts: Magento2.5 Related Products image url path incorrect after moving website

texts:
I recently moved a Magento 2.5 based website to a new server and now on the product detail page the related products the product images are not loading. Upon inspecting the image tag I see the url is missing a /

So for example the image tag is

<img src="https://*****.com/pub/media/catalog/productb/i/abcnails.jpg" class="img-resposive">

However the correct url for the image is

img src="https://****.com/pub/media/catalog/product/b/i/bipc080nails.jpg" class="img-resposive">

So I am wondering how I could fi this? Not sure what database table stores this information or if there is somewhere else to fix this?


texts:
I'm building a Magento 2.2 store and would like to remove all customer pages like login, account, register, etc.

I noticed that I can remove all customer routes (customer/ * / *) when I remove the /vendor/magento/module-customer/etc/frontend/routes.xml file but of course that's not a neat way, do you guys have an idea on how this could be achieved in a neat way?

Thanks!


texts: How to add function in a block,call this function in template

texts:
In the layout file app/code/Magento/Checkout/view/frontend/layout/default.xml

<block class="Magento\Checkout\Block\Cart\Sidebar" name="minicart" as="minicart" after="logo" template="cart/minicart.phtml">

I would like to add a new method to block Sidebar.php.

Then call in the template and the minicart.phtml.

I found in app/code/Magento/Customer/etc/frontend/di.xml:

<type name="Magento\Checkout\Block\Cart\Sidebar">
    <plugin name="customer_cart" type="\Magento\Customer\Model\Cart\ConfigPlugin" />
</type>

so I cant't use preference for Magento\Checkout\Block\Cart\Sidebar to add function in Sidebar.php.

Preference didn't work:  app/code/Vendor/Modulename/etc/di.xml

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <preference for="Magento\Checkout\Block\Cart\Sidebar" type="Vendor\Modulename\Block\Cart\Sidebar" />
</config>

block file Vendor\Modulename\Block\Cart\Sidebar

class Sidebar extends \Magento\Checkout\Block\Cart\Sidebar
{
    protected $_logger;

    public function __construct(
        \Magento\Framework\View\Element\Template\Context $context,
        \Magento\Customer\Model\Session $customerSession,
        \Magento\Checkout\Model\Session $checkoutSession,
        \Magento\Catalog\Helper\Image $imageHelper,
        \Magento\Customer\CustomerData\JsLayoutDataProviderPoolInterface $jsLayoutDataProvider,
        array $data
    ){
        $this->_logger = $context->getLogger();
        parent::__construct($context, $customerSession, $checkoutSession, $imageHelper, $jsLayoutDataProvider, $data);
    }

    public function getCheckoutUrl()
    {
        $this->_logger->addDebug("AAAAAAAAAAA");
        return parent::getCheckoutUrl(); // TODO: Change the autogenerated stub
    }

}

In var/log/debug.log, there is nothing to print


texts: How to remove ?___from_store=fr on the url?

texts:
I'm using Magento 2.2.2, I have others language store in my Magento.

how to remove ?___from_store=fr on the url?

http://exsample.com/en/?___from_store=fr


texts: Magento 2 : Show cart items total to header cart link

texts:
I want to display cart items total to my header cart link.

I have get some reference from https://magento.stackexchange.com/ but not any solution work for me.

Some are works but only it will display on cart page header link. It will display on all pages if cache is display. cart total not showing on other pages header link when cache is enable.

Any one have done this. Please help.


texts: OOTB Checkout page has "Define order date"; what is this and how do I remove it

texts:
I'm using Magento community 1.9.  On the Magento out of the box checkout page in the billing information section is a "Define order date" field the user can put any date into.

What is this?  How can I remove it?  I don't remember seeing it in v1.8

Thanks


texts: magento 2 - modify db_schema.xml field length

texts:
I want to change the length of action_operator field to 50 character in catalogrule_product table
<column xsi:type="varchar" name="action_operator" nullable="true" length="10" default="to_fixed"
                comment="Action Operator"/>

how to override the db_schema.xml
Please help


texts: Why protected methods can't be intercepted?

texts:
I was wondering why it's not possible to create plugins for protected methods. There's this piece of code in the Magento\Framework\Interception\Code\Generator\Interceptor:

protected function _getClassMethods()
{
    $methods = [$this->_getDefaultConstructorDefinition()];

    $reflectionClass = new \ReflectionClass($this->getSourceClassName());
    $publicMethods = $reflectionClass->getMethods(\ReflectionMethod::IS_PUBLIC);
    foreach ($publicMethods as $method) {
        if ($this->isInterceptedMethod($method)) {
            $methods[] = $this->_getMethodInfo($method);
        }
    }
    return $methods;
}

It checks if method is public before allowing it to be intercepted. It can be easily changed by creating a preference in the di.xml of own module, of course, like this:

<?xml version="1.0"?>
<config>
    <preference for="Magento\Framework\Interception\Code\Generator\Interceptor" type="MyVendor\MyModule\Model\MyInterceptorModel" />
</config>

and rewriting the _getClassMethods with the \ReflectionMethod::IS_PUBLIC changed to \ReflectionMethod::IS_PUBLIC | \ReflectionMethod::IS_PROTECTED inside of the method.

But I wonder why it's not possible to intercept protected methods in the original method definition? Does it have a major impact on the performance, or there's some other reason for that, like allowing 3rd party modules to make Magento logic too "messy"?


texts:
I am trying to install Magento2 on my local machine but it is not working properly

It throws the following error:

Fatal error: Maximum function nesting level of '100' reached, aborting! in \lib\Magento\Autoload\IncludePath.php on line 56

Is it because I am using a Windows server?
Does Magento2 works on Linux only?


texts: magento2 module frontend - Change downloadable links

texts:
With Magento2 template path hints turned on, (custom theme inherited from luma) I have been able to locate that  want to change some of the code in the area where the downloadable links are shown on a product details page of a downloadable item.

(really I want to hide that on the storefront, and only show to customer on purchase) - as it's pushing the add to cart button way down the page, etc.

From the template path hints, I have located I want to edit:

vendor > magento > module-downloadable > frontend > templates > catalog > product > links.phtml

so I thought that I could create a similar structure in my:

app > design > frontend > MYVENDOR > MYTHEME

directory, but it's not working, no matter what, so I am thinking I am not necessarily doing it right. If I could see an example of how to accomplish this, I should be able to figure out others on my own :) thanks in advance for any help!


texts:
I am trying to figure how to add an attribute (UPC) to display just under the SKU on the my product page. I have tried in the past with no such luck. I really need this to work. I have found several different post for this to work and of them worked. The closet one I have found was from this link:
Display Custom Attribute Multiplace Place on Products Details Page Magento 2
Problem I am having is the UPC Code from the attribute does display in the right place, however the Label (UPC:) does not show, only the UPC #. I used the same code below:
You can display custom attributes by creating block after the sku block in catalog_product_view
Create catalog_product_view.xml in "app\design\frontend\VENDOR\THEME\Magento_Catalog\layout\catalog_product_view.xml"

Create custom_attr.phtml file in "app\design\frontend\VENDOR\THEME\Magento_Catalog\templates\product\view\custom_attr.phtml"
getProduct(); ?>

getData('upc_code') ?>


texts: Save value of multiselect admin magento 1.9

texts:
I create a custom block, for create slider in front-end.
This work perfectly in admin and save in database.

Now I just add, a groupe_id instance of groupe_customer.
so lock my form :

     $fieldset->addField('target', 'select', array(
        'label'     => Mage::helper('home')->__("Target"),
        'name'  => 'sd['.$this->getSlideNumber().'][target]',
        'values'    => Mage::getModel("home/home_target")->getOptionArray()
    ));

    $groups = Mage::getResourceModel('customer/group_collection')
              ->toOptionArray();

    $fieldset->addField('type_groupe_client', 'multiselect',array(
        'label'    =>  Mage::helper('home')->__('Group Customer'),
        'title'     => Mage::helper('home')->__('Group Customer'),
        'name'      => 'sd['.$this->getSlideNumber().'][type_groupe_client]',
        'values'   =>  $groups,
        'required'  => true,
    ));

When i choose multiple group customer,
In my controller saveAction(), I check value of multi-select look my code :
i do this =>

 $slideData['type_groupe_client'] = implode(',',$slideData['type_groupe_client']);

    // Slider
            foreach ($this->getRequest()->getParam("sd") as $idx => $slideData) {
                $slide = Mage::getModel("home/home");
                if (isset($slideData["home_id"])) {
                    $slide->load($slideData["home_id"]);
                    if(isset($slideData["remove"])){
                        if(is_file(Mage::getBaseDir('media') . DS . $slide->getImage())){
                            unlink(Mage::getBaseDir('media') . DS . $slide->getImage());
                        }
                        $slide->delete();
                        continue;
                    }
                } else {
                    $slide->setCreatedAt(Zend_Date::now()->get(Zend_Date::ISO_8601));
                }

                $slideData['type_groupe_client'] = implode(',',$slideData['type_groupe_client']);
                $slide->addData($slideData);

                if (isset($_FILES['sd'.$idx.'_image']['name']) and ( file_exists($_FILES['sd'.$idx.'_image']['tmp_name']))) {
                    $slide->setImage($this->manageImage('sd'.$idx.'_image'));
                } else {
                    $imageParams = $this->getRequest()->getParam('sd'.$idx.'_image');
                    if (isset($imageParams['delete']) && $imageParams['delete'] == 1) {
                        if(is_file(Mage::getBaseDir('media') . DS . $slide->getImage())){
                            unlink(Mage::getBaseDir('media') . DS . $slide->getImage());
                        }
                        $slide->setImage("");
                    }
                }

                $slide->save();
            }

When I  var_dump( $slideData['type_groupe_client']), I have so good id in string : string(7) "0,1,2,3"
But they not save in database, just the first when I choose , in this example only 0 is save in my row.

Can you help me please ?


texts: magento2- Not able to get details of logged in customer.

texts:
I have tried to obtain the logged in customer details by using all the below models. Nothing seems to work. Are  there any other ways to obtain the user data?

    \Magento\Backend\Model\Auth\Session $backendAuthSession,
    \Magento\Checkout\Model\Session $currentSession ,
    \Magento\Customer\Model\SessionFactory $customerSession,


texts: Get Home page url in outside magento php file

texts:
I want to get magento home page url in outside magento file I have added below code in my custom file pdf.php

require_once("app/Mage.php");
Mage::app();
$connectionWrite   = Mage::getSingleton('core/resource')->getConnection('core_write');
$product['inv_ID'] = $inv_ID = $_GET['id']; // Get the inventory ID
$_product          = Mage::getModel('catalog/product')->load($inv_ID);
if ($_product->getShortDescription()) {
    $product['Ad_Line'] = $_product->getShortDescription();
    $product['price']   = $_product->getFinalPrice();
    $product['image']   = $_product->getImage();
    echo $url                = Mage::getBaseUrl()
    exit;
}

I am getting below output

http://localhost/xxxproject/pdf.php/

How can I get direct home page url like below without using $_SERVER

http://localhost/xxxproject/


texts: Customer password reset always says link as expired after upgrade from 2.2 to 2.3

texts:
I recently upgraded from 2.2 to 2.3 and kept the theme idk if that's important.
Now when a customer tries to reset his password the email is sent but if he clicks the link that should go to the password reset page, just send to the page where you insert the email to receive the link and tell the link as expired, so it's impossible to reset the password atm.
What can cause this? Some 2.2 references in theme that don't work at 2.3? Server permissions or session not configured well? (we changed the server too so it's a new one might need some configuration idk).
I checked this
Magento Reset Password Link not working after upgrade
but couldn't understand how to fix this.
Thanks :D


texts: ElasticSearch Error while Installing Magneto 2.4 using CLI

texts:
I'm trying to install a fresh Magento 2.4 CE on my local PC.
Here are my configurations:

Magento 2.4 CE
Apache 2.4.41 (Ubuntu)
PHP 7.4.8 (cli)
mysql Ver 8.0.21 for Linux on x86_64 (MySQL Community Server - GPL)
Ubuntu 20.04 LTS

I'm trying to install using CLI with this command:
    php bin/magento setup:install
    --backend-frontname="admin"
    --key="240d2e12f0f04fdd2dfd2a9bd616b1f6"
    --session-save="files"
    --db-host="localhost:9200"
    --db-name="magento24"
    --db-user="root"
    --db-password="admin123"
    --base-url="http://127.0.0.1/magento24/"
    --base-url-secure="https://127.0.0.1/magento24/"
    --admin-user="admin"
    --admin-password="admin123"
    --admin-email="admin@admin.com"
    --admin-firstname="admin"
    --admin-lastname="khan"

I am getting error Here
In SearchConfig.php line 81:

  Could not validate a connection to Elasticsearch. No alive nodes found in your cluster


texts:
Recently I have migrated our website. I have imported the orders however they all by default were changed to complete and no invoice was created.

The main problem is that it works great with one order number, more order numbers comma-delimited get me the PHP error.

Parse error: syntax error, unexpected ',' in /home/alphalasulaco/public_html/inv-cre.php on line 5

I have compiled the following script to change the order to processing and allow invoice creation.

<?php
require_once('./app/Mage.php');
Mage::app();

$orderNumbers = 100124858,100124857;

$order = Mage::getModel("sales/order")->load($orderNumbers);

$collection = Mage::getModel('sales/order')->getCollection()
                ->addFieldToFilter('increment_id', array('in' => $orderNumbers));

foreach ($collection as $order) {
            $order->setState(Mage_Sales_Model_Order::STATE_PROCESSING)
                ->setStatus(Mage_Sales_Model_Order::STATE_PROCESSING)
                ->save();
}

try {
if($order->canInvoice())
{
$invoice = Mage::getModel('sales/service_order', $order)->prepareInvoice();

if ($invoice->getTotalQty()) {

$invoice->setRequestedCaptureCase(Mage_Sales_Model_Order_Invoice::CAPTURE_OFFLINE);
$invoice->register();
$transaction = Mage::getModel('core/resource_transaction')
->addObject($invoice)
->addObject($invoice->getOrder());
$transaction->save();
Mage::getSingleton('core/session')->addSuccess('Invoice Created Successfully.');
}else{
 Mage::getSingleton('core/session')->addError('Can not create invoice without Product Quantities');
 }

}else{
Mage::getSingleton('core/session')->addError('Can not create invoice');
}
}
catch (Mage_Core_Exception $e) {
 echo $e->getMessage();
}
?>


texts: How to add a template in a custom page layout in Magento 2

texts:
i have created a custom page layout, which i have used for my homepage. But when i m trying to add a template in it my template is not showing . Given below is my layout code
<?xml version="1.0" ?>
<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_layout.xsd">
    <update handle="empty"/>
    <referenceContainer name="page.wrapper">
        <container name="header.container" as="header_container" label="Page Header Container"  htmlTag="header" htmlClass="page-header" before="main.content"/>
        <container name="page.top" as="page_top" label="After Page Header" after="header.container"/>
        <container name="footer-container" as="footer" before="before.body.end" label="Page Footer Container" htmlTag="footer" htmlClass="page-footer" />
    </referenceContainer>
    <referenceBlock name="page.main.title" template="Magento_Theme::components/slider/slider-image.phtml"/>
    <referenceContainer name="main.content" htmlTag="main" htmlClass="page-main-full-width" />
</layout>

Template is present in the same folder as mentioned in the block (components/slider/slider-image.phtml). But the block itself is not showing. I want to display it after the header.
please help


texts:
How do you list all root categories (and their child categories) in a template file (phtml) in magento2?

I'm running 0.74.0-beta5.


texts:
I am building a new site and i am facing a problem.
I want to add in each product some info in a tab. so this tab should be a free text in each product.
I saw modules that you make tabs and then assign it in product. This way i have to make 15000 tabs!
Is there an option to add in my product backend a field that i  can add the text i need and display it as tab on frontend?
My theme has a custom tab ready. please see

I have made one attribute named "text"
Please can you inform me what i must write in the custom tab data in order for the "text" attribute to span in custom tab?
This way i will write anything i need in this text attribute in each product and display it in the custom tab i already have.
Please advise
Thank you very much for your support.


texts: Add Tier Price Programmatically Could not save group price Error - Magento 2.2.x

texts:
I am having issues setting tier prices in Magento 2.2.1, I have looked at setting the tier prices and used below to get myself started:

Magento 2: How to set Tier Pricing Programatically Group Wise

This seemed to work sometimes but am getting the below error which seems to suggest that something has changed since the update to 2.2.x. Upon some research the old method is depreciated and suggests to use another interface:

Warning: Invalid argument supplied for foreach() in /var/www/mage2/public_html/vendor/magento/module-catalog/Model/Product/TierPriceManagement.php on line 103

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

But cannot work out quite how to fix am currently using the below:

\Magento\Catalog\Api\ProductTierPriceManagementInterface $tierInterface
$this->tierInterface = $tierInterface;
$this->tierInterface->add($sku,$groupId,$price, '1');

From the github issue i have changed: \Magento\Catalog\Api\ProductTierPriceManagementInterface $tierInterface to \Magento\Catalog\Api\ScopedProductTierPriceManagementInterface $tierInterface

Update

Ok so i injected that class into my construct and use like below:

$tierPrice = $this->tierPrice;
$tierPrice->setQty(floatval(1));
$tierPrice->setValue(floatval($price));
$tierPrice->setCustomerGroupId($groupId);
$this->tierInterface->add($sku,$tierPrice);

I was getting errors about values not being valid so used floatval to fix this. Still errors occur for a lot of products however always the same products but others work fine everytime. New error:

Exception #0 (Magento\Framework\Exception\CouldNotSaveException): Could not save group price

Not sure why this happens will keep working on it but seems similar to what i was experiencing with the previous method. These seem to be products that i got to work previously as have prices set bet they cannot be set again. I have tried removing the old price and it works after that but need it to just update programaticaly.

Still unsure how to set these prices for a specific website however but may ask this in a separate question.


texts: Magento 2 Checkout shipping methods page UI modification

texts:
I am new to Magento and I am trying to do some small modifications on the Magento 2's Checkout shipping methods page - to add an image right after the shipping description.

A link tutorial or a brief description will really help.

Thank you in advance.


texts:
In our Magento 2 store suddenly order id has started skipping order id by 1.

Here is the order id example:

  000000011  000000013  000000015  000000017  000000019

I went through multiple posts like magento-order-number-issue and magento-order-id-increment-jumps, and they say like due to failed/in-complete payment, or customer doesn't complete all checkout steps this issue might occur.

So my question is, it should happen only in the mentioned scenarios and from next order it should work fine if there isn't any issue, but in my case it always skips 1 order. I have observed this for around 100 orders.

Few posts also suggest due to abandoned cart this issue might occur so I have truncated quote tables using below query, still issue exists.

SET FOREIGN_KEY_CHECKS=0;

TRUNCATE TABLE `quote`;
TRUNCATE TABLE `quote_address`;
TRUNCATE TABLE `quote_address_item`;
TRUNCATE TABLE `quote_id_mask`;
TRUNCATE TABLE `quote_item`;
TRUNCATE TABLE `quote_item_option`;
TRUNCATE TABLE `quote_payment`;
TRUNCATE TABLE `quote_shipping_rate`;

SET FOREIGN_KEY_CHECKS=1;

How I can fix this?


texts: Magento 2 Get image Url in controller or helper?

texts:
How to get the image in the controller or helper. For example, the path of images folder:

 /app/code/Nitesh/Module/view/frontend/web/images
 /app/code/Nitesh/Module/view/frontend/web/images/image.png


texts: Magento 2 : How to get admin user data in observer?

texts:
I have observer of backend_auth_user_login_success.

I need the data of the admin user who is login in observer.

Can anyone please help me into this?

Thanks in advance.


texts: Magento 2 data migration 'Permission denied' error

texts:
I am trying to migrate magento 1.9 data to magento 2.

A week ago I was able to do settings verfication and run migrate data command than I have to stop work. Now after coming back when I try to resume same work I got an error.

I am beginer in Magento please, tell me fix for this.This is the same error I am getting while trying to cross check settings and to migrate data.


texts: Magento1: How to detect if configurable product has dynamical price?

texts:
Some configurable products look like simple product but with sizes or swatches options in it where the price is not changed.

Others configurable products have flexible price which depends on options.

How to detect the difference between these types of configurable products?

I have an idea to just loop all simple products and compare the finalprice but its enough expensive by resources.


texts:
Issue

It doesn't appear that my merged/minified files are being updated when changed whilst in Production Mode. For example, I made a change to this file:

app/design/frontend/Theme/theme_child/web/css/styles.css

But even after I run the following, the styling isn't taking effect:

bin/magento setup:di:compile
bin/magento setup:static-content:deploy en_GB en_US
bin/magento cache:flush

I even hit the Flush Javascript/CSS Cache button on the backend.

Question

Am I missing a step? Is this a known "gremlin"? Could some of the cached files not be clearing as expected? What folder can I rm -rf to manually purge them so they can be re-deployed?

Notes:

The changes do take affect on my Dev Server
It's not my browsers cache
I'm not using a CDN


texts: How to get attributes of an attribute set that are not present in default attribute set

texts:
How can I get the list of attributes of an attribute set that are not present in the default attribute set?

I tried the following codes:

$attributeSetId = Mage::getModel('eav/entity_attribute_set')
            ->load($_product->getAttributeSetId())->getId();
$attributes = Mage::getModel('catalog/product_attribute_api')
            ->items($attributeSetId);

echo '<pre>';
print_r($attributes);
die();

But this returned an array with all the attributes including the attributes of default attribute set whereas I just needed the attributes that only belonged to my custom attribute set.


texts: How to export all the attribute and its options in magento 2

texts:
I wish to export all the attribute and its options in magento 2 via script.
Please provide me a solution, How to export attributes and its options


texts: How to use theme 1.9 into Magento version 2.x

texts:
What will happen if i imported theme 1.9 into Magento version 2.x
and is there a way or procedures to migrate theme 1.x to 2.x
or is it difficult to do it?


texts: Why wont my extension update using composer?

texts:
I am trying to update Amasty Layered Navigation. Following their documentation it says to type in the command-

composer update amasty/shopby

When I do that it says

Package "amasty/shopby" listed for update is not installed. Ignoring.

It is installed and functions properly. When I run a status to see if it is enabled it is in there. Am I using the wrong command?

I can see the repo username and password in the auth.json file.

Update:

The extension was originally installed by ftp, meaning I had to update by using ftp. If anyone knows how to update an extension with composer after installing with ftp I would be curious.


texts: Var/Report folder fills up and crashes site

texts:
I really need to fix a problem with my site because it's creating reports, and then blowing out my inodes limit (250,000).

When I delete the folder and then my .trash folder, I go back to 50k inodes but the folder fills up fast again of the next day or two. Whilst that is filling up, my site will do the blank screen of death until I delete my cache folder (Mage--2).

I haven't done anything new or installed any addons etc. I'm at the point where I'll pay someone to go through my Magento site and just fix everything!

Where should I start?

    a:5:{i:0;s:0:"";i:1;s:1215:"#0 /home/fgdadmin/public_html/factory/app/code/core/Mage/Api/Model/Server/V2/Adapter/Soap.php(79): Mage_Api_Model_Server_Adapter_Soap->fault(0, 'Invalid encodin...')
#1 /home/fgdadmin/public_html/factory/app/code/core/Mage/Api/Model/Server.php(138): Mage_Api_Model_Server_V2_Adapter_Soap->run()
#2 /home/fgdadmin/public_html/factory/app/code/core/Mage/Api/controllers/V2/SoapController.php(46): Mage_Api_Model_Server->run()
#3 /home/fgdadmin/public_html/factory/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Api_V2_SoapController->indexAction()
#4 /home/fgdadmin/public_html/factory/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('index')
#5 /home/fgdadmin/public_html/factory/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#6 /home/fgdadmin/public_html/factory/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#7 /home/fgdadmin/public_html/factory/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#8 /home/fgdadmin/public_html/factory/index.php(88): Mage::run('', 'store')
#9 {main}";s:3:"url";s:13:"/api/v2_soap/";s:11:"script_name";s:10:"/index.php";s:4:"skin";s:5:"admin";}


texts:
I am trying to integrate Prompt Cloud API with magento. For it the basic requirement is to install Unirest library. I am trying to install using composer:

composer require mashape/unirest-php

And then trying to call it in head.phtml as:

$headers = array('Accept' => 'application/json');
$query = array('foo' => 'hello', 'bar' => 'world');

$response = Unirest\Request::post('http://mockbin.com/request', $headers, $query);

But it is throwing error: 500 Internal server error. When I have checked system.log file, it contains following errors:

  2017-06-27T08:42:29+00:00 ERR (3): Warning: include(Unirest\Request.php): failed to open stream: No such file or directory  in /lib/Varien/Autoload.php on line 94


texts:
How can i add my custom block in catalog category page

<catalog_category_layered translate="label">
    <label>Catalog Category (Anchor)</label>
    <reference name="content">
        <block type="catalog/category_view" name="category.products" template="catalog/category/view.phtml">
            <block type="catalog/product_list" name="product_list" template="catalog/product/list.phtml">
                <block type="catalog/product_list_toolbar" name="product_list_toolbar" template="catalog/product/list/toolbar.phtml">
                    <block type="page/html_pager" name="product_list_toolbar_pager"/>
<!-- i add my block here  -->
                    <block type="quickview/quickview" name="quickview" template="quickview/quickview.phtml" />
                </block>
            </block>
        </block>
    </reference>
</catalog_category_layered>


texts: Ajax request from checkout page js file to controller

texts:
I want to make Ajax request to the controller from checkout page. The code I have in github and in my previous post were I did not specify that I want to make the ajax request from js file placed on checkout page. The current ajax request is displaying an error in console: jquery.js:9666 POST https://127.0.0.1:8443/checkout/vendor_checkoutshipping/index/htmlcreator 404 (Not Found). Does anyone have any idea what might be wrong that the ajax request is not made?

I prefer not to use phtml file, unless I really need to (the reason for using would possible  security threth). (My module currently does not need phtml file.)


texts: I need to update my magento version to the latest 2.2 from magento. Can any one please suggest me the best way to do this. I have soo many extensions installed on my site along with some paid extension. How I can check there compatibility?


texts: What is ->load(),->getData() in Magento and how does it work

texts:
$deal_m = Mage::getModel('dailydeals/deal')->load($deal_ids, 'deal_id');
$deal_m->getData()

I can understand this above code will get the values for deal_id=$deal_ids from the deal table.But I don't know the process or logic behind this ->load(),->getData().

Can any one please explain this process or suggest me any learning tutorials?


texts: I create a custom theme and I want to reuse lumas start page. My theme is having as parent Luma. I created the widget and Block and injected to start page but seems to not picking up the stylesheet. How do I get it work?


texts: app/mage.php not found in sub-sub-directory store

texts:
having problem making this work. our magento store is located inside of existing php framework. example.com/magento.

our substore will be example.com/magento/store1

I already try different suggestion:

../app/Mage.php
/../app/Mage.php
$_SERVER['DOCUMENT_ROOT'] . /substore/app/Mage.php
and the whole path of the Mage.php

but still none of the list works..

UPDATE 22/07/2015

after removing all item except

if (version_compare(phpversion(), '5.2.0', '<')===true) {...}
require_once '../app/Mage.php';
umask(0);
Mage::run('example', 'website');

and don't forget to reindex, System > Index Management...

the website show but the problem is that template, css and js is not loading..
when i view the source code it shows example/online/store1/css/style.css
how can i fix this? thank you very much

UPDATE 2 22/07/2015

The solution in the problem of not loading template, css and js can be fix in the system > config > web.. change the base link urls..

UPDATE 23/07/2015

after fixing everything, i found another problem in here. the magento connect manager is not working. it only displays The page you requested was not found, and we have a fine guess why. please help me to fix this problem. thank you


texts: Magento 2. How to store media (images) and output to custom Data Grid View

texts:
In general

I need a module, that works with custom in DB table.

It's main purpose is in providing data to a simple js script, that puts pins on the map.

Question

How to organise storing of images, that should appear above the pin.

Assumptions

I assume, that in DB we should store a link and an image — in some folder, designed for that. Also I assume, that Magento 2 has some classes to work organise this process.

What do I have for now

Code

Code examples are very dirty because of using a couple of another's examples. Main was Ashsmith Blog


texts: Magento 2.2.2 - how to remove company and zipcode from billing address from checkout

texts:
I would like to remove postcode and company from the billing address showing in second step [#payment] of checkout page.

copied checkout_index_index.xml file from vendor and placed in theme folder checkout_index_index.xml is as follows:

<referenceBlock name="checkout.root">
        <arguments>
            <argument name="jsLayout" xsi:type="array">
                <item name="components" xsi:type="array">
                    <item name="checkout" xsi:type="array">
                        <item name="children" xsi:type="array">
                            <item name="steps" xsi:type="array">
                                <item name="children" xsi:type="array">
                                    <item name="billing-step" xsi:type="array">
                                        <item name="children" xsi:type="array">
                                            <item name="payment" xsi:type="array">
                                                <item name="component" xsi:type="string">Magento_Checkout/js/view/payment</item>
                                                <item name="children" xsi:type="array">
                                                    <item name="billing-address-fieldset" xsi:type="array">
                                                        <item name="children" xsi:type="array">
                                                            <item name="postcode" xsi:type="array">
                                                                <item name="visible"                                                                xsi:type="boolean">false</item>
                                                            </item>
                                                            <item name="company" xsi:type="array">
                                                                <item name="visible"                                                                xsi:type="boolean">false</item>
                                                            </item>
                                                        </item>
                                                    </item>
                                                </item>
                                            </item>
                                        </item>
                                    </item>
                                </item>
                            </item>
                        </item>
                    </item>
                </item>
            </argument>
        </arguments>
    </referenceBlock>
</body>

When removed pub/static/frontend/ var/cache, var/page_cache, var/view_preprocessed and run below CLI commands.

php bin/magento s:s:d -f
php bin/magento c:f

i do not see changes to Billing Address fields. I'm not sure what I'm missing.

Thanks in advance.


texts: add new custom option in cart not work while adding configurable product using observer

texts:
when I addtocart simple product and added new custom option using checkout_cart_product_add_after,it works perfect and cart displays new custom option in cart but my new custom option does not display while adding configurable product,it display configurable attribute lable and its value('color: blue') but my new custom option does not see.

My config.xml

<checkout_cart_product_add_after>
                <observers>
                    <test_checkout_product_observer>
                        <type>singleton</type>
                        <class>test/observer</class>
                        <method>addTestInfo</method>
                    </test_checkout_product_observer>
                </observers>
</checkout_cart_product_add_after>

My Observer.php

public function addTestInfo($observer)
    {
        $quoteItem = $observer->getEvent()->getQuoteItem();

            $additionalOptions = array(array(
                            'code'  => 'test_shop_info',
                            'label' => 'label1',
                            'value' => 'value1',
                        ));

                        $quoteItem->addOption(array(
                            'code'  => 'additional_options',
                            'value' => serialize($additionalOptions),
                        ));
        return $this;
    }

What I want:
My new custom option should display in cart while adding configurable product.

This above code works only simple product not for configurable product.
Thanks in advance


texts:
I have a custom EAV model that uses custom tables for comments that can be set on either products or categories. I have created an admin for these using the standard EAV admin form.

In my controller, I have a save action:

public function saveAction()
{
    if ($data = $this->getRequest()->getPost()) {
        try {
            $model = Mage::getModel('module/comment');
            $model->setData($data)->setId($this->getRequest()->getParam('id'));
            $model->save();

            $this->_getSession()->addSuccess(
                Mage::helper('module')->__('The comment has been saved.'));

            $this->_redirect('*/*/edit',
                array('id' => $this->getRequest()->getParam('id')));
        }
        catch (Exception $e) {
            Mage::logException($e);
            $this->_getSession()->addError(Mage::helper('module')->__('There was an error saving the comment'));
        }
    }
    $this->_redirect('*/*/index');
}

When I save the form with a new comment, the grid page shows the new comment. But, when I look in the database with the following query:

SELECT * FROM eav_comment_text WHERE entity_id = 1;

I see the following:

+----------+----------------+--------------+----------+-----------+-------------------------+
| value_id | entity_type_id | attribute_id | store_id | entity_id | value                   |
+----------+----------------+--------------+----------+-----------+-------------------------+
|        1 |             31 |          964 |        0 |         1 | test                    |
|        4 |             31 |          964 |        0 |         1 | test adding another one |
+----------+----------------+--------------+----------+-----------+-------------------------+

Can anyone explain why (a) Magento does not replace the existing value and (b) how Magento knows which one to show in the grid?


texts: Display only two subcategories under subcategories on frontpage

texts:
I have many subcategories under sub categories. But i want only first two subcategories to be displayed on home page. Please guide how can i do without deleting the subcategories.
I have used web and people extension to customize the display on categories and subcategories


texts: It's slowing the loading process. Why do I need beetailer.js in rwd 1.9?


texts: Tax charged for virtual products only order

texts:
I'm having a strange issue with orders containing only virtual products.
I have configured tax-calculation to be based on shipping address.

  configuration -> tax -> calculation settings -> tax calculation based
  on -> shipping address

Although, tax is still applied for the virtual products.
I have found another question regarding the opposite situation (tax not applied for virtual products) - now I'm quite puzzled why it does not work here as intended (-> no tax for virtual orders).

Any ideas what may be wrong? Thanks!


texts:
I am using Magento 1.13.1.0. and recently i found that the related products I assigned from Admin got removed after some time.  I check the cron and its already working fine.

Is there any other specific issue that remove the product relation ?
Any help will be appreciated.

Thanks


texts: Where in the code stock will be updated when purchase is made

texts:
Want to make a change in the code, so if  the stock go to 0 then and the Manufacturer's Suggested Retail Price are higher then the sale price, then it will change to price to Manufacturer's Suggested Retail Price.

I use Magento ver. 1.9.3.3

Thanks


texts: Get if product created by QuickCreate of Configurable in Observer

texts:
Have an environment in which I can only shoot a certain method if the product is simple or configurable (when it is a simple put the son of a configurable I can not shoot), the problem that when I the one Quick Create it triggers as simple, is there any way to differentiate the product was created by the Quick Create or not?

Thank you so much


texts: Add gift registry button in Product list view

texts:
I'm using a plugin Gift Registry
I want to add the Gift Registry button in my product list view. Right now the plugin only shows in the Product View Page. But we want to show it in the Product List View. But I keep getting an error of

I added this in the Magento_Catalog/layout/default.xml

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceContainer name="content">
            <block class="Magenest\GiftRegistry\Block\Product\View" name="product.info.additem" as="additem" template="Magenest_GiftRegistry::item/configure/addto.phtml" after="-"/>
        </referenceContainer>
    </body>
</page>

It seems that it's throwing an error because the plugin is expecting an ID for the product page but since this is a product list so its not really targeting the exact product but a list. How can I fix this?

Update:

I tried to add this in the Magento_Catalog/layut/catalog_category_view.xml and added this code

As you can see the highlighted below is pointing to a block in Magenest\GiftRegistry\Block\Product\View but when running the site it's giving me this error

As seen here. It's pointing to the magento-catalog/Block/Product/View instead in Magenest\GiftRegistry\Block\Product\View. How do I let the layout loads the correct block?